## ## 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 IApplicationsRoot(IWAeUPObject): """A container for student application containers. """ def addApplicationContainer(container, name=None): """Add an application container. Adds an application container that implements `interface` under the name `name`. `container` the container instance to be added. Should implement :class:`IApplicationContainer`. `name` the name under which the container will be accessible. We usually use names like ``pume_2011`` to indicate, that the new container will contain student applications for a certain screening type (``pume``) and of the year 2011. """ class IApplicationContainer(IWAeUPObject): """An application container contains student applications. """ id = schema.TextLine( title = u'Internal ID', required = True, ) title = schema.TextLine( title = u'Short description of the type of applications stored here.', required = True, default = u'Untitled', ) description = schema.Text( title = u'Human readable description in reST format', required = False, default = u'Not set.' ) startdate = schema.Date( title = u'Date when the application period starts', required = False, default = None, ) enddate = schema.Date( title = u'Date when the application period ends', required = False, default = None, ) strict_deadline = schema.Bool( title = u'Forbid additions after deadline (enddate)', required = True, default = True, ) 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. """