- Timestamp:
- 22 Jan 2013, 08:55:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/interfaces.py
r9537 r9905 30 30 from waeup.aaue.payments.interfaces import ICustomOnlinePayment 31 31 from waeup.aaue.interfaces import MessageFactory as _ 32 33 class CourseSource(BasicContextualSourceFactory):34 """A course source delivers all courses inside the portal by looking35 up a catalog.36 """37 def getValues(self, context):38 catalog = getUtility(ICatalog, name='courses_catalog')39 courses = sorted(list(catalog.searchResults(40 code=(None, None))),key=lambda value: value.code)41 payments = context.student.getPaymentTuples()42 if (context.student.current_session, 'schoolfee_2', 'paid') in payments:43 pass44 else:45 courseslist = list(courses)46 for course in courseslist:47 if course.semester == 2:48 courses.remove(course)49 return courses50 51 def getToken(self, context, value):52 return value.code53 54 def getTitle(self, context, value):55 return "%s - %s (%d)" % (56 value.code, value.title[:64], value.semester)57 32 58 33 class ICustomStudentBase(INigeriaStudentBase): … … 119 94 """ 120 95 121 class ICustomCourseTicketAdd(IKofaObject):122 """An interface for adding course tickets.123 124 """125 course = schema.Choice(126 title = _(u'Course'),127 source = CourseSource(),128 readonly = False,129 )130 131 96 class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo): 132 97 """Representation of a student. Skip regular reg_number validation.
Note: See TracChangeset for help on using the changeset viewer.