Changeset 9400 for main/waeup.kofa/trunk


Ignore:
Timestamp:
24 Oct 2012, 05:16:32 (12 years ago)
Author:
Henrik Bettermann
Message:

Make special handling of beds more easily customizable.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
3 edited

Legend:

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

    r9199 r9400  
    2323from waeup.kofa.interfaces import MessageFactory as _
    2424from waeup.kofa.hostels.vocabularies import (
    25     bed_letters, blocks, special_handling, StudentSource)
     25    bed_letters, blocks, SpecialHandlingSource, StudentSource)
    2626
    2727class IHostelsContainer(IKofaObject):
     
    172172    special_handling = schema.Choice(
    173173        title = _(u'Special Handling'),
    174         vocabulary = special_handling,
     174        source = SpecialHandlingSource(),
    175175        required = True,
    176176        default = u'regular',
  • main/waeup.kofa/trunk/src/waeup/kofa/hostels/vocabularies.py

    r9373 r9400  
    2424from waeup.kofa.interfaces import SimpleKofaVocabulary
    2525from waeup.kofa.interfaces import MessageFactory as _
     26from waeup.kofa.university.vocabularies import ContextualDictSourceFactoryBase
    2627
    2728NOT_OCCUPIED = u'not occupied'
     
    5354    def getTitle(self, context, value):
    5455        return "%s - %s" % (value, self.acco_students(context)[value])
     56
     57class SpecialHandlingSource(ContextualDictSourceFactoryBase):
     58    """A application category source delivers all special handling categories
     59    provided for accommodation booking.
     60    """
     61    #: name of dict to deliver from kofa utils.
     62    DICT_NAME = 'SPECIAL_HANDLING_DICT'
    5563
    5664bed_letters = SimpleKofaVocabulary(
     
    8795    (_('Block Q'),'Q'),
    8896    )
    89 
    90 special_handling = SimpleKofaVocabulary(
    91     (_('Regular Hostel'),'regular'),
    92     (_('Blocked Hostel'),'blocked'),
    93     (_('Postgraduate Hostel'),'pg'),
    94     )
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py

    r9131 r9400  
    143143        3: 'Combined',
    144144        9: 'N/A'
     145        }
     146
     147    SPECIAL_HANDLING_DICT = {
     148        'regular': 'Regular Hostel',
     149        'blocked': 'Blocked Hostel',
     150        'pd': 'Postgraduate Hostel'
    145151        }
    146152
Note: See TracChangeset for help on using the changeset viewer.