[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 | """ |
---|
| 19 | Container which holds the data of the orginal applicant object created during |
---|
| 20 | application and copied after admission. |
---|
| 21 | """ |
---|
| 22 | import grok |
---|
| 23 | from zope.component.interfaces import IFactory |
---|
| 24 | from zope.interface import implementedBy |
---|
| 25 | from waeup.sirp.applicants.interfaces import IApplicantBaseData |
---|
| 26 | from waeup.sirp.students.interfaces import IStudentNavigation |
---|
| 27 | from waeup.sirp.utils.helpers import attrs_to_fields |
---|
| 28 | |
---|
| 29 | class 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 | |
---|
| 42 | StudentApplication = attrs_to_fields(StudentApplication) |
---|
| 43 | |
---|
| 44 | class 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) |
---|