Changeset 6990


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.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
2 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
  • main/waeup.sirp/trunk/src/waeup/sirp/students/workflow.py

    r6816 r6990  
    44from hurry.workflow.workflow import Transition, WorkflowState, NullCondition
    55from hurry.workflow.interfaces import IWorkflowState, IWorkflowTransitionEvent
    6 from waeup.sirp.interfaces import IObjectHistory, IWAeUPWorkflowInfo
     6from waeup.sirp.interfaces import (
     7    IObjectHistory, IWAeUPWorkflowInfo,
     8    CREATED, ADMITTED, CLEARANCE, REQUESTED, CLEARED, PAID, RETURNING,
     9    REGISTERED, VALIDATED)
    710from waeup.sirp.workflow import WAeUPWorkflow, WAeUPWorkflowInfo
    811from waeup.sirp.utils.helpers import get_current_principal
    912from waeup.sirp.students.interfaces import IStudent
    1013from waeup.sirp.students.utils import set_returning_data
    11 
    12 CREATED = 'created'
    13 ADMITTED = 'admitted'
    14 CLEARANCE = 'clearance started'
    15 REQUESTED = 'clearance requested'
    16 CLEARED = 'cleared'
    17 PAID = 'school fee paid'
    18 RETURNING = 'returning'
    19 REGISTERED = 'courses registered'
    20 VALIDATED = 'courses validated'
    2114
    2215REGISTRATION_TRANSITIONS = (
Note: See TracChangeset for help on using the changeset viewer.