source: main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py @ 5681

Last change on this file since 5681 was 5681, checked in by uli, 14 years ago

Add application categories and a respective vocabulary.

File size: 4.0 KB
Line 
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 applicants and related components.
23"""
24from zope import schema
25from waeup.sirp.interfaces import IWAeUPObject, SimpleWAeUPVocabulary
26
27#: Categories of applications we support.
28#: Yet not complete nor correct.
29APPLICATION_CATEGORIES = (
30    ('Direct Entry Screening Exam (PDE)', 'pde'),
31    ('Post-UME', 'pume'),
32    ('Post-UDE', 'pude'),
33    ('PCE', 'pce'),
34    ('Common Entry Screening Test (CEST)', 'cest'),
35    )
36
37#: A :class:`waeup.sirp.interfaces.SimpleWAeUPVocabulary` of supported
38#: application categories.
39application_categories_vocab = SimpleWAeUPVocabulary(*APPLICATION_CATEGORIES)
40
41class IApplicantsRoot(IWAeUPObject):
42    """A container for university applicants containers.
43    """
44    def addApplicantsContainer(container, name=None):
45        """Add an applicants container.
46
47        Adds an applicants container that implements `interface`
48        under the name `name`.
49
50        `container` the container instance to be added. Should
51          implement :class:`IApplicantsContainer`.
52
53        `name`
54          the name under which the container will be accessible. We
55          usually use names like ``pume_2011`` to indicate, that the
56          new container will contain university applicants for a
57          certain screening type (``pume``) and of the year 2011.
58        """
59
60class IApplicantsContainer(IWAeUPObject):
61    """An applicants container contains university applicants.
62
63    """
64    id = schema.TextLine(
65        title = u'Internal ID',
66        required = True,
67        )
68
69    title = schema.TextLine(
70        title = u'Short description of the type of applicants stored here.',
71        required = True,
72        default = u'Untitled',
73        )
74   
75    description = schema.Text(
76        title = u'Human readable description in reST format',
77        required = False,
78        default = u'Not set.'
79        )
80
81    startdate = schema.Date(
82        title = u'Date when the application period starts',
83        required = False,
84        default = None,
85        )
86
87    enddate = schema.Date(
88        title = u'Date when the application period ends',
89        required = False,
90        default = None,
91        )
92
93    strict_deadline = schema.Bool(
94        title = u'Forbid additions after deadline (enddate)',
95        required = True,
96        default = True,
97        )
98
99    def archive(id=None):
100        """Create on-dist archive of applicants stored in this term.
101
102        If id is `None`, all applicants are archived.
103
104        If id contains a single id string, only the respective
105        applicants are archived.
106
107        If id contains a list of id strings all of the respective
108        applicants types are saved to disk.
109        """
110
111    def clear(id=None, archive=True):
112        """Remove applicants of type given by 'id'.
113
114        Optionally archive the applicants.
115       
116        If id is `None`, all applicants are archived.
117
118        If id contains a single id string, only the respective
119        applicants are archived.
120
121        If id contains a list of id strings all of the respective
122        applicant types are saved to disk.
123
124        If `archive` is ``False`` none of the archive-handling is done
125        and respective applicants are simply removed from the
126        database.
127        """
Note: See TracBrowser for help on using the repository browser.