コード例 #1
0
ファイル: import.py プロジェクト: cemeyer2/comoto
 def get_offerings_for_course(self, id=None):
     if id is None:
         return ""
     check_course_access(id)
     course = h.get_object_or_404(Course, id=id)
     offerings = course.offerings
     offerings.sort()
     offerings.reverse()
     result = []
     for offering in offerings:
         result.append(HTML.option(offering.semester.to_str(), value=offering.id))
     return u''.join(result)
コード例 #2
0
 def before_field_options(self):
     result = []
     for id, label in model.Nav.get_before_options(request.params.getone('selected')):
         result.append(HTML.option(label, value=id))
     result.append(HTML.option('[At the end]', value=''))
     return u''.join(result)