Ignore:
Timestamp:
3 Nov 2011, 15:31:49 (13 years ago)
Author:
Henrik Bettermann
Message:

Move registration_state definitions from students/workflow.py to interfaces.py.

File:
1 edited

Legend:

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

    r6929 r6990  
    1111from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
    1212
     13CREATED = 'created'
     14ADMITTED = 'admitted'
     15CLEARANCE = 'clearance started'
     16REQUESTED = 'clearance requested'
     17CLEARED = 'cleared'
     18PAID = 'school fee paid'
     19RETURNING = 'returning'
     20REGISTERED = 'courses registered'
     21VALIDATED = 'courses validated'
     22
    1323default_frontpage = u'' + open(os.path.join(
    1424        os.path.dirname(__file__), 'frontpage.rst'), 'rb').read()
     
    3141
    3242academic_sessions_vocab = SimpleWAeUPVocabulary(*academic_sessions())
     43
     44registration_states_vocab = SimpleWAeUPVocabulary(
     45    ('created', CREATED),
     46    ('admitted', ADMITTED),
     47    ('clearance started', CLEARANCE),
     48    ('clearance requested', REQUESTED),
     49    ('cleared', CLEARED),
     50    ('school fee paid', PAID),
     51    ('returning', RETURNING),
     52    ('courses registered', REGISTERED),
     53    ('courses validated', VALIDATED),
     54    )
    3355
    3456class FatalCSVError(Exception):
     
    208230
    209231    title = schema.TextLine(
    210         title = u'Title of frontpage',
     232        title = u'Title of Frontpage',
    211233        default = u'Welcome to the Student Information and Registration ' +
    212234                  u'Portal of Sample University',
     
    225247        required = False,
    226248        default = default_frontpage,
     249        )
     250
     251    accommodation_session = schema.Choice(
     252        title = u'Accommodation Booking Session',
     253        source = academic_sessions_vocab,
     254        default = datetime.now().year,
     255        required = False,
     256        readonly = False,
     257        )
     258
     259    accommodation_states = schema.List(
     260        title = u'Allowed States for Accommodation Booking',
     261        value_type = schema.Choice(
     262            vocabulary = registration_states_vocab,
     263            ),
     264        default = [],
    227265        )
    228266
Note: See TracChangeset for help on using the changeset viewer.