Ignore:
Timestamp:
25 Feb 2017, 17:59:16 (8 years ago)
Author:
Henrik Bettermann
Message:

Customize warnCreditsOOR and IStudentStudyLevel.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/studylevel.py

    r14408 r14591  
    5252    grok.provides(ICustomStudentStudyLevel)
    5353
     54    @property
     55    def total_credits_s1(self):
     56        total = 0
     57        for ticket in self.values():
     58            if ticket.semester == 1 and not ticket.outstanding:
     59                total += ticket.credits
     60        return total
     61
     62    @property
     63    def total_credits_s2(self):
     64        total = 0
     65        for ticket in self.values():
     66            if ticket.semester == 2 and not ticket.outstanding:
     67                total += ticket.credits
     68        return total
     69
    5470CustomStudentStudyLevel = attrs_to_fields(
    55     CustomStudentStudyLevel, omit=['total_credits', 'gpa'])
     71    CustomStudentStudyLevel, omit=[
     72    'total_credits', 'total_credits_s1', 'total_credits_s2', 'gpa'])
    5673
    5774class CustomStudentStudyLevelFactory(StudentStudyLevelFactory):
Note: See TracChangeset for help on using the changeset viewer.