Changeset 13831


Ignore:
Timestamp:
13 Apr 2016, 21:50:34 (9 years ago)
Author:
Henrik Bettermann
Message:

Add matric_number.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py

    r13828 r13831  
    2020"""
    2121
     22#from grok import getSite
    2223from zope import schema
     24#from zope.interface import invariant, Invalid
     25#from zope.component import getUtility
     26#from zope.catalog.interfaces import ICatalog
    2327from zc.sourcefactory.basic import BasicSourceFactory
    2428from waeup.kofa.applicants.interfaces import (
     
    152156        )
    153157
     158    matric_number = schema.TextLine(
     159        title = _(u'Uniben Matriculation Number'),
     160        required = False,
     161        readonly = False,
     162        )
     163
    154164    registration_cats = schema.List(
    155165        title = _(u'Registration Categories'),
     
    159169        )
    160170
    161 
     171#    @invariant
     172#    def matric_number_exists(applicant):
     173#        if applicant.matric_number:
     174#            catalog = getUtility(ICatalog, name='students_catalog')
     175#            accommodation_session = getSite()['hostels'].accommodation_session
     176#            student = catalog.searchResults(matric_number=(
     177#                applicant.matric_number, applicant.matric_number))
     178#            if len(student) != 1:
     179#                raise Invalid(_("Matriculation number not found."))
    162180
    163181class ICustomUGApplicant(INigeriaUGApplicant):
Note: See TracChangeset for help on using the changeset viewer.