## ## interfaces.py ## Login : ## Started on Sun Jan 16 15:30:01 2011 Uli Fouquet ## $Id$ ## ## Copyright (C) 2011 Uli Fouquet ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## """Interfaces regarding student applications and related components. """ from zope import schema from waeup.sirp.interfaces import IWAeUPObject class IApplicationTerm(IWAeUPObject): """An application term is a school term for which students can apply. I.e. something like 'Summer semester 2011'. Each term has (beside an ID and a human readabe description) a date where it starts and a date where it ends. Note that term dates are not necessarily equal to application terms for the respective academic term. """ id = schema.TextLine( title = u'Internal ID', required = True, ) description = schema.TextLine( title = u'Human readable description', required = False, default = u'Not set.' ) startdate = schema.Date( title = u'Date when the term starts', required = False, default = None, ) enddate = schema.Date( title = u'Date when the term ends', required = False, default = None, ) def addApplicationType(interface): """Add an application type. This enables for this application term to add applications of the given type. `interface` should be an interface derived from :class:`IStudentApplication`. """ def archive(id=None): """Create on-dist archive of applications stored in this term. If id is `None`, all applications are archived. If id contains a single id string, only the respective applications are archived. If id contains a list of id strings all of the respective application types are saved to disk. """ def clear(id=None, archive=True): """Remove applications of type given by 'id'. Optionally archive the applications. If id is `None`, all applications are archived. If id contains a single id string, only the respective applications are archived. If id contains a list of id strings all of the respective application types are saved to disk. If `archive` is ``False`` none of the archive-handling is done and respective applications are simply removed from the database. """