Ignore:
Timestamp:
26 Mar 2007, 17:51:30 (18 years ago)
Author:
joachim
Message:

sort list by semester and course_id (in custom)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/getStudyLevelInfo.py

    r1586 r1641  
    4040    return 0.0
    4141
    42 def cmp_semester(a,b):
    43     if a['semester'] == b['semester']:
     42def cmp_semester_id(a,b):
     43    s1 = "%(semester)s%(id)s" % a
     44    s2 = "%(semester)s%(id)s" % b
     45    if s1 == s2:
    4446        return 0
    45     if a['semester'] > b['semester']:
     47    if s1 > s2:
    4648        return 1
    4749    return -1
     
    104106        normal.append(d)
    105107info['credits_total'] = credits_total
    106 carry_overs.sort(cmp_semester)
     108carry_overs.sort(cmp_semester_id)
    107109info['carry_overs'] = carry_overs
    108 normal.sort(cmp_semester)
     110normal.sort(cmp_semester_id)
    109111info['normal'] = normal
    110112
Note: See TracChangeset for help on using the changeset viewer.