- Timestamp:
- 30 Mar 2012, 17:55:44 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.custom/trunk/src/waeup/custom/applicants/applicant.py
r7866 r8012 20 20 from zope.interface import implementedBy 21 21 from waeup.kofa.applicants.applicant import Applicant, ApplicantFactory 22 from waeup.custom.applicants.interfaces import IPGApplicant, IPGApplicantEdit 22 from waeup.kofa.applicants.interfaces import IApplicantEdit 23 from waeup.kofa.utils.helpers import attrs_to_fields 24 from waeup.custom.applicants.interfaces import( 25 IApplicant, IUGApplicantEdit, IPGApplicantEdit) 23 26 24 class PGApplicant(Applicant): 25 grok.implements(IPGApplicant,IPGApplicantEdit) 26 grok.provides(IPGApplicant) 27 class Applicant(Applicant): 27 28 28 class PGApplicantFactory(ApplicantFactory): 29 """A factory for pg applicants. 29 grok.implements(IApplicant, IUGApplicantEdit, IPGApplicantEdit) 30 grok.provides(IApplicant) 31 32 # Set all attributes of Applicant required in IApplicant as field 33 # properties. Doing this, we do not have to set initial attributes 34 # ourselves and as a bonus we get free validation when an attribute is 35 # set. 36 Applicant = attrs_to_fields(Applicant) 37 38 class ApplicantFactory(ApplicantFactory): 39 """A factory for customized applicants. 30 40 """ 31 grok.name(u'waeup.PGApplicant')32 title = u"Create a new pg applicant.",33 description = u"This factory instantiates new pg applicant instances."34 41 35 42 def __call__(self, *args, **kw): 36 return PGApplicant()43 return Applicant() 37 44 38 45 def getInterfaces(self): 39 return implementedBy( PGApplicant)46 return implementedBy(Applicant)
Note: See TracChangeset for help on using the changeset viewer.