source: main/waeup.sirp/trunk/src/waeup/sirp/students/application.py @ 7339

Last change on this file since 7339 was 7339, checked in by Henrik Bettermann, 13 years ago

Set up StudentApplication? class which implements IApplicantBaseData.

  • Property svn:keywords set to Id
File size: 2.0 KB
RevLine 
[7339]1## $Id: application.py 7339 2011-12-13 17:28:32Z henrik $
2##
3## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
4## This program is free software; you can redistribute it and/or modify
5## it under the terms of the GNU General Public License as published by
6## the Free Software Foundation; either version 2 of the License, or
7## (at your option) any later version.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12## GNU General Public License for more details.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program; if not, write to the Free Software
16## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17##
18"""
19Container which holds the data of the orginal applicant object created during
20application and copied after admission.
21"""
22import grok
23from zope.component.interfaces import IFactory
24from zope.interface import implementedBy
25from waeup.sirp.applicants.interfaces import IApplicantBaseData
26from waeup.sirp.students.interfaces import IStudentNavigation
27from waeup.sirp.utils.helpers import attrs_to_fields
28
29class StudentApplication(grok.Container):
30    """This is a container for application data.
31    """
32    grok.implements(IApplicantBaseData, IStudentNavigation)
33    grok.provides(IApplicantBaseData)
34
35    def __init__(self):
36        super(StudentApplication, self).__init__()
37        return
38
39    def getStudent(self):
40        return self.__parent__
41
42StudentApplication = attrs_to_fields(StudentApplication)
43
44class StudentApplicationFactory(grok.GlobalUtility):
45    """A factory for students.
46    """
47    grok.implements(IFactory)
48    grok.name(u'waeup.StudentApplication')
49    title = u"Create a new student application object.",
50    description = u"This factory instantiates new student application instances."
51
52    def __call__(self, *args, **kw):
53        return StudentApplication()
54
55    def getInterfaces(self):
56        return implementedBy(StudentApplication)
Note: See TracBrowser for help on using the repository browser.