source: main/waeup.sirp/trunk/src/waeup/sirp/applicants/container.py @ 5811

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

Add REQUIRES_JAMBDATA attribute for applicant containers.

File size: 2.5 KB
RevLine 
[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]23Containers for university applicants.
[5649]24"""
25import grok
[5676]26from waeup.sirp.applicants.interfaces import IApplicantsContainer
[5649]27
[5676]28class ApplicantsContainer(grok.Container):
29    """An applicants container contains university applicants.
[5649]30    """
[5676]31    grok.implements(IApplicantsContainer)
[5649]32
[5682]33    REQUIRES_JAMBDATA = False
34    name = None
[5649]35    title = None
36    description = None
37    startdate = None
38    enddate = None
[5650]39    strict_deadline = True
[5649]40
41    def archive(self, app_ids=None):
[5676]42        """Create on-dist archive of applicants stored in this term.
[5649]43
[5676]44        If app_ids is `None`, all applicants are archived.
[5649]45
46        If app_ids contains a single id string, only the respective
[5676]47        applicants are archived.
[5649]48
49        If app_ids contains a list of id strings all of the respective
[5676]50        applicants types are saved to disk.
[5649]51        """
52        raise NotImplemented()
53
54    def clear(self, app_ids=None, archive=True):
[5676]55        """Remove applicants of type given by 'id'.
[5649]56
[5676]57        Optionally archive the applicants.
[5649]58       
[5676]59        If id is `None`, all applicants are archived.
[5649]60
61        If id contains a single id string, only the respective
[5676]62        applicants are archived.
[5649]63
64        If id contains a list of id strings all of the respective
[5676]65        applicant types are saved to disk.
[5649]66
67        If `archive` is ``False`` none of the archive-handling is done
[5676]68        and respective applicants are simply removed from the
[5649]69        database.
70        """
71        raise NotImplemented()
[5682]72
73class JAMBBasedApplicantsContainer(ApplicantsContainer):
74    """An applicants container contains university applicants.
75
76    For applicants added to this container JAMB data must be available
77    already.
78    """
79    REQUIRES_JAMBDATA = True
Note: See TracBrowser for help on using the repository browser.