Ignore:
Timestamp:
30 Mar 2012, 17:55:44 (13 years ago)
Author:
Henrik Bettermann
Message:

Remove all ApplicantsContainerProvider? components and use same form customization technique as in students. In contrast to the students package, postgraduate applicants are only defined in the custom package. Thus the implementation is slightly different.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.custom/trunk/src/waeup/custom/applicants/applicant.py

    r7866 r8012  
    2020from zope.interface import implementedBy
    2121from waeup.kofa.applicants.applicant import Applicant, ApplicantFactory
    22 from waeup.custom.applicants.interfaces import IPGApplicant, IPGApplicantEdit
     22from waeup.kofa.applicants.interfaces import IApplicantEdit
     23from waeup.kofa.utils.helpers import attrs_to_fields
     24from waeup.custom.applicants.interfaces import(
     25    IApplicant, IUGApplicantEdit, IPGApplicantEdit)
    2326
    24 class PGApplicant(Applicant):
    25     grok.implements(IPGApplicant,IPGApplicantEdit)
    26     grok.provides(IPGApplicant)
     27class Applicant(Applicant):
    2728
    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.
     36Applicant = attrs_to_fields(Applicant)
     37
     38class ApplicantFactory(ApplicantFactory):
     39    """A factory for customized applicants.
    3040    """
    31     grok.name(u'waeup.PGApplicant')
    32     title = u"Create a new pg applicant.",
    33     description = u"This factory instantiates new pg applicant instances."
    3441
    3542    def __call__(self, *args, **kw):
    36         return PGApplicant()
     43        return Applicant()
    3744
    3845    def getInterfaces(self):
    39         return implementedBy(PGApplicant)
     46        return implementedBy(Applicant)
Note: See TracChangeset for help on using the changeset viewer.