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/hostels
Files:
2 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     )
Note: See TracChangeset for help on using the changeset viewer.