Changeset 2633


Ignore:
Timestamp:
12 Nov 2007, 18:46:13 (17 years ago)
Author:
joachim
Message:

sort courses for courses_view, eine eigene headline pro Semester erfordert erhebliche Gehirnakrobatik in Kombination mit dem Batch view.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/waeup_academics/getCoursesInfo.py

    r1366 r2633  
    5959    row['is_editable'] = mtool.checkPermission('Modify portal content', ro)
    6060    rows.append(row)
    61 #from Products.zdb import set_trace;set_trace()
    62 ##res = context.portal_catalog(container_path="%s/courses" % cp)
    63 ##items = []
    64 ##for sem in ('1','2'):
    65 ##    for r in res:
    66 ##        row = {}
    67 ##        ro = r.getObject()
    68 ##        rd = ro.getContent()
    69 ##        if rd.semester != sem:
    70 ##            continue
    71 ##        row['id'] = r.getId
    72 ##        row['title'] = rd.Title()
    73 ##        row['semester'] = rd.semester
    74 ##        row['url'] = ro.absolute_url()
    75 ##        row['review_state'] = wf.getInfoFor(ro,'review_state','None')
    76 ##        row['is_editable'] = mtool.checkPermission('Modify portal content', ro)
    77 ##        items.append(row)
     61rows.sort(cmp=lambda x,y: cmp("%(semester)s%(id)s" % x,
     62                              "%(semester)s%(id)s" % y))
    7863info['courses'] = rows
    7964return info
Note: See TracChangeset for help on using the changeset viewer.