source: main/waeup.sirp/trunk/src/waeup/sirp/applications/container.py @ 5649

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

Add first basic applications container implementation.

File size: 2.2 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"""
23Containers for student applications.
24"""
25import grok
26from waeup.sirp.applications.interfaces import IApplicationContainer
27
28class ApplicationContainer(grok.Container):
29    """An application container contains student applications.
30    """
31    grok.implements(IApplicationContainer)
32
33    id = None
34    title = None
35    description = None
36    startdate = None
37    enddate = None
38
39    def archive(self, app_ids=None):
40        """Create on-dist archive of applications stored in this term.
41
42        If app_ids is `None`, all applications are archived.
43
44        If app_ids contains a single id string, only the respective
45        applications are archived.
46
47        If app_ids contains a list of id strings all of the respective
48        application types are saved to disk.
49        """
50        raise NotImplemented()
51
52    def clear(self, app_ids=None, archive=True):
53        """Remove applications of type given by 'id'.
54
55        Optionally archive the applications.
56       
57        If id is `None`, all applications are archived.
58
59        If id contains a single id string, only the respective
60        applications are archived.
61
62        If id contains a list of id strings all of the respective
63        application types are saved to disk.
64
65        If `archive` is ``False`` none of the archive-handling is done
66        and respective applications are simply removed from the
67        database.
68        """
69        raise NotImplemented()
Note: See TracBrowser for help on using the repository browser.