Ignore:
Timestamp:
8 Nov 2018, 18:02:10 (6 years ago)
Author:
Henrik Bettermann
Message:

Customize getAccommodationDetails

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.dspg/trunk/src/kofacustom/dspg/students/utils.py

    r15184 r15221  
    4545                    return True
    4646        return False
     47
     48    def getAccommodationDetails(self, student):
     49        """Determine the accommodation data of a student.
     50        """
     51        d = {}
     52        d['error'] = u''
     53        hostels = grok.getSite()['hostels']
     54        d['booking_session'] = hostels.accommodation_session
     55        d['allowed_states'] = hostels.accommodation_states
     56        d['startdate'] = hostels.startdate
     57        d['enddate'] = hostels.enddate
     58        d['expired'] = hostels.expired
     59        # Determine bed type
     60        bt = 'all'
     61        if student.sex == 'f':
     62            sex = 'female'
     63        else:
     64            sex = 'male'
     65        special_handling = 'regular'
     66        d['bt'] = u'%s_%s_%s' % (special_handling,sex,bt)
     67        return d
    4768
    4869    def getReturningData(self, student):
Note: See TracChangeset for help on using the changeset viewer.