Ignore:
Timestamp:
19 Nov 2012, 18:08:39 (12 years ago)
Author:
Henrik Bettermann
Message:

Remove total_credits method from view. This is already done in the content class.

Calculate momentary gpa and show on level page.

File:
1 edited

Legend:

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

    r9684 r9687  
    8181
    8282    @property
     83    def gpa(self):
     84        gpa = 0
     85        credits_counted = 0
     86        for ticket in self.values():
     87            if ticket.score:
     88                credits_counted += ticket.credits
     89                gpa += ticket.credits * ticket.weight
     90        if credits_counted:
     91            gpa = float(gpa)/credits_counted
     92        return gpa
     93
     94    @property
    8395    def is_current_level(self):
    8496        try:
Note: See TracChangeset for help on using the changeset viewer.