[5649] | 1 | ## |
---|
| 2 | ## container.py |
---|
| 3 | ## Login : <uli@pu.smp.net> |
---|
| 4 | ## Started on Thu Jan 20 04:33:18 2011 Uli Fouquet |
---|
| 5 | ## $Id$ |
---|
| 6 | ## |
---|
| 7 | ## Copyright (C) 2011 Uli Fouquet |
---|
| 8 | ## This program is free software; you can redistribute it and/or modify |
---|
| 9 | ## it under the terms of the GNU General Public License as published by |
---|
| 10 | ## the Free Software Foundation; either version 2 of the License, or |
---|
| 11 | ## (at your option) any later version. |
---|
| 12 | ## |
---|
| 13 | ## This program is distributed in the hope that it will be useful, |
---|
| 14 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | ## GNU General Public License for more details. |
---|
| 17 | ## |
---|
| 18 | ## You should have received a copy of the GNU General Public License |
---|
| 19 | ## along with this program; if not, write to the Free Software |
---|
| 20 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
| 21 | ## |
---|
| 22 | """ |
---|
[5676] | 23 | Containers for university applicants. |
---|
[5649] | 24 | """ |
---|
| 25 | import grok |
---|
[5821] | 26 | from waeup.sirp.applicants.interfaces import ( |
---|
[6069] | 27 | IApplicantsContainer, IApplicantsContainerAdd, |
---|
| 28 | IApplicantsContainerProvider, |
---|
[5821] | 29 | ) |
---|
[6069] | 30 | from zope.schema.fieldproperty import FieldProperty |
---|
[5649] | 31 | |
---|
[5676] | 32 | class ApplicantsContainer(grok.Container): |
---|
| 33 | """An applicants container contains university applicants. |
---|
[5649] | 34 | """ |
---|
[6069] | 35 | grok.implements(IApplicantsContainer,IApplicantsContainerAdd) |
---|
| 36 | #grok.provides(IApplicantsContainer) |
---|
[5649] | 37 | |
---|
[6070] | 38 | title = u'Simple applicants container' |
---|
[5821] | 39 | description = u'Simple container for regular applicants' |
---|
[5649] | 40 | startdate = None |
---|
| 41 | enddate = None |
---|
[5650] | 42 | strict_deadline = True |
---|
[6069] | 43 | provider = None |
---|
| 44 | code = None |
---|
[5858] | 45 | |
---|
[5649] | 46 | def archive(self, app_ids=None): |
---|
[5676] | 47 | """Create on-dist archive of applicants stored in this term. |
---|
[5649] | 48 | |
---|
[5676] | 49 | If app_ids is `None`, all applicants are archived. |
---|
[5649] | 50 | |
---|
| 51 | If app_ids contains a single id string, only the respective |
---|
[5676] | 52 | applicants are archived. |
---|
[5649] | 53 | |
---|
| 54 | If app_ids contains a list of id strings all of the respective |
---|
[5676] | 55 | applicants types are saved to disk. |
---|
[5649] | 56 | """ |
---|
| 57 | raise NotImplemented() |
---|
| 58 | |
---|
| 59 | def clear(self, app_ids=None, archive=True): |
---|
[5676] | 60 | """Remove applicants of type given by 'id'. |
---|
[5649] | 61 | |
---|
[5676] | 62 | Optionally archive the applicants. |
---|
[5649] | 63 | |
---|
[5676] | 64 | If id is `None`, all applicants are archived. |
---|
[5649] | 65 | |
---|
| 66 | If id contains a single id string, only the respective |
---|
[5676] | 67 | applicants are archived. |
---|
[5649] | 68 | |
---|
| 69 | If id contains a list of id strings all of the respective |
---|
[5676] | 70 | applicant types are saved to disk. |
---|
[5649] | 71 | |
---|
| 72 | If `archive` is ``False`` none of the archive-handling is done |
---|
[5676] | 73 | and respective applicants are simply removed from the |
---|
[5649] | 74 | database. |
---|
| 75 | """ |
---|
| 76 | raise NotImplemented() |
---|
[6069] | 77 | |
---|
[5821] | 78 | class ApplicantsContainerProvider(grok.GlobalUtility): |
---|
| 79 | """A utility that provides basic applicants containers. |
---|
| 80 | """ |
---|
[5846] | 81 | grok.implements(IApplicantsContainerProvider) |
---|
[6070] | 82 | grok.name('waeup.sirp.applicants.ApplicantsContainer') |
---|
[5821] | 83 | |
---|
| 84 | factory = ApplicantsContainer |
---|