1 | ## |
---|
2 | ## interfaces.py |
---|
3 | ## Login : <uli@pu.smp.net> |
---|
4 | ## Started on Sun Jan 16 15:30:01 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 | """Interfaces regarding student applications and related components. |
---|
23 | """ |
---|
24 | from zope import schema |
---|
25 | from waeup.sirp.interfaces import IWAeUPObject |
---|
26 | |
---|
27 | class IApplicationTerm(IWAeUPObject): |
---|
28 | """An application term is a school term for which students can apply. |
---|
29 | |
---|
30 | I.e. something like 'Summer semester 2011'. Each term has (beside |
---|
31 | an ID and a human readabe description) a date where it starts and |
---|
32 | a date where it ends. |
---|
33 | |
---|
34 | Note that term dates are not necessarily equal to application |
---|
35 | terms for the respective academic term. |
---|
36 | """ |
---|
37 | id = schema.TextLine( |
---|
38 | title = u'Internal ID', |
---|
39 | required = True, |
---|
40 | ) |
---|
41 | |
---|
42 | description = schema.TextLine( |
---|
43 | title = u'Human readable description', |
---|
44 | required = False, |
---|
45 | default = u'Not set.' |
---|
46 | ) |
---|
47 | |
---|
48 | startdate = schema.Date( |
---|
49 | title = u'Date when the term starts', |
---|
50 | required = False, |
---|
51 | default = None, |
---|
52 | ) |
---|
53 | |
---|
54 | enddate = schema.Date( |
---|
55 | title = u'Date when the term ends', |
---|
56 | required = False, |
---|
57 | default = None, |
---|
58 | ) |
---|
59 | |
---|
60 | def addApplicationType(interface): |
---|
61 | """Add an application type. |
---|
62 | |
---|
63 | This enables for this application term to add applications of |
---|
64 | the given type. |
---|
65 | |
---|
66 | `interface` |
---|
67 | should be an interface derived from :class:`IStudentApplication`. |
---|
68 | """ |
---|
69 | |
---|
70 | def archive(id=None): |
---|
71 | """Create on-dist archive of applications stored in this term. |
---|
72 | |
---|
73 | If id is `None`, all applications are archived. |
---|
74 | |
---|
75 | If id contains a single id string, only the respective |
---|
76 | applications are archived. |
---|
77 | |
---|
78 | If id contains a list of id strings all of the respective |
---|
79 | application types are saved to disk. |
---|
80 | """ |
---|
81 | |
---|
82 | def clear(id=None, archive=True): |
---|
83 | """Remove applications of type given by 'id'. |
---|
84 | |
---|
85 | Optionally archive the applications. |
---|
86 | |
---|
87 | If id is `None`, all applications are archived. |
---|
88 | |
---|
89 | If id contains a single id string, only the respective |
---|
90 | applications are archived. |
---|
91 | |
---|
92 | If id contains a list of id strings all of the respective |
---|
93 | application types are saved to disk. |
---|
94 | |
---|
95 | If `archive` is ``False`` none of the archive-handling is done |
---|
96 | and respective applications are simply removed from the |
---|
97 | database. |
---|
98 | """ |
---|