## ## 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 applicants and related components. """ from zope import schema from waeup.sirp.interfaces import IWAeUPObject, SimpleWAeUPVocabulary #: Categories of applications we support. #: Yet not complete nor correct. APPLICATION_CATEGORIES = ( ('Direct Entry Screening Exam (PDE)', 'pde'), ('Post-UME', 'pume'), ('Post-UDE', 'pude'), ('PCE', 'pce'), ('Common Entry Screening Test (CEST)', 'cest'), ) #: A :class:`waeup.sirp.interfaces.SimpleWAeUPVocabulary` of supported #: application categories. application_categories_vocab = SimpleWAeUPVocabulary(*APPLICATION_CATEGORIES) class IApplicantsRoot(IWAeUPObject): """A container for university applicants containers. """ def addApplicantsContainer(container, name=None): """Add an applicants container. Adds an applicants container that implements `interface` under the name `name`. `container` the container instance to be added. Should implement :class:`IApplicantsContainer`. `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 university applicants for a certain screening type (``pume``) and of the year 2011. """ class IApplicantsContainer(IWAeUPObject): """An applicants container contains university applicants. """ REQUIRES_JAMBDATA = schema.Bool( title = u'JAMB data required', description = u'This container requires JAMB data to be available.', required = True, default = False, ) name = schema.TextLine( title = u'Internal ID', required = True, ) title = schema.TextLine( title = u'Short description of the type of applicants 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 applicants stored in this term. If id is `None`, all applicants are archived. If id contains a single id string, only the respective applicants are archived. If id contains a list of id strings all of the respective applicants types are saved to disk. """ def clear(id=None, archive=True): """Remove applicants of type given by 'id'. Optionally archive the applicants. If id is `None`, all applicants are archived. If id contains a single id string, only the respective applicants are archived. If id contains a list of id strings all of the respective applicant types are saved to disk. If `archive` is ``False`` none of the archive-handling is done and respective applicants are simply removed from the database. """