## ## container.py ## Login : ## Started on Thu Jan 20 04:33:18 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 ## """ Containers for university applicants. """ import grok from waeup.sirp.applicants.interfaces import ( IApplicantsContainer, IApplicantContainerProvider, ) class ApplicantsContainer(grok.Container): """An applicants container contains university applicants. """ grok.implements(IApplicantsContainer) REQUIRES_JAMBDATA = False name = None title = u'Simple applicant container' description = u'Simple container for regular applicants' startdate = None enddate = None strict_deadline = True def archive(self, app_ids=None): """Create on-dist archive of applicants stored in this term. If app_ids is `None`, all applicants are archived. If app_ids contains a single id string, only the respective applicants are archived. If app_ids contains a list of id strings all of the respective applicants types are saved to disk. """ raise NotImplemented() def clear(self, app_ids=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. """ raise NotImplemented() class JAMBBasedApplicantsContainer(ApplicantsContainer): """An applicants container contains university applicants. For applicants added to this container JAMB data must be available already. """ REQUIRES_JAMBDATA = True class ApplicantsContainerProvider(grok.GlobalUtility): """A utility that provides basic applicants containers. """ grok.implements(IApplicantContainerProvider) grok.name('waeup.sirp.applicant.ApplicantsContainer') factory = ApplicantsContainer