Ignore:
Timestamp:
22 May 2013, 19:26:05 (11 years ago)
Author:
Henrik Bettermann
Message:

Introduce low_jamb_score property attribute. course2 is only editable if low_jamb_score is True.

Browser tests will follow.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.futminna/trunk/src/waeup/futminna/applicants/applicant.py

    r10146 r10206  
    4242    grok.provides(ICustomApplicant)
    4343
     44    @property
     45    def low_jamb_score(self):
     46        jamb_score = getattr(self, 'jamb_score', None)
     47        course1 = getattr(self, 'course1', None)
     48        limit = getattr(course1, 'custom_float_1', None)
     49        if None in (jamb_score, limit):
     50            return False
     51        if jamb_score < limit:
     52            return True
     53        return False
     54
    4455# Set all attributes of CustomApplicant required in ICustomApplicant as field
    4556# properties. Doing this, we do not have to set initial attributes
Note: See TracChangeset for help on using the changeset viewer.