Changeset 9502 for main/waeup.aaue
- Timestamp:
- 2 Nov 2012, 06:13:11 (12 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/interfaces.py
r9496 r9502 37 37 def getValues(self, context): 38 38 catalog = getUtility(ICatalog, name='courses_catalog') 39 payments_folder = context.student['payments']40 payments = [(p.p_session, p.p_category, p.p_state)41 for p in payments_folder.values()]42 39 courses = sorted(list(catalog.searchResults( 43 40 code=(None, None))),key=lambda value: value.code) 41 payments = context.student.getPaymentTuples() 44 42 if (context.student.current_session, 'schoolfee_2', 'paid') in payments: 45 43 pass -
main/waeup.aaue/trunk/src/waeup/aaue/students/student.py
r8991 r9502 35 35 grok.provides(ICustomStudent) 36 36 37 def getPaymentTuples(self): 38 """Special AAUE method needed for selecting courses in semesters 39 the student has paid for. 40 """ 41 payments = [(p.p_session, p.p_category, p.p_state) 42 for p in self['payments'].values()] 43 return payments 37 44 38 45 # Set all attributes of Student required in IStudent as field -
main/waeup.aaue/trunk/src/waeup/aaue/students/studylevel.py
r8867 r9502 22 22 import grok 23 23 from zope.component.interfaces import IFactory 24 from zope.component import createObject 24 25 from zope.interface import implementedBy 25 26 from waeup.kofa.utils.helpers import attrs_to_fields … … 37 38 grok.implements(ICustomStudentStudyLevel, IStudentNavigation) 38 39 grok.provides(ICustomStudentStudyLevel) 40 41 def addCertCourseTickets(self, cert): 42 """Collect all certificate courses and create course 43 tickets automatically. 44 45 Add ticket only if student has paid for the course.semester. 46 """ 47 payments = self.student.getPaymentTuples() 48 if cert is not None: 49 for key, val in cert.items(): 50 if val.level != self.level: 51 continue 52 if val.course.semester == 2 and \ 53 not (self.student.current_session, 54 'schoolfee_2', 'paid') in payments: 55 continue 56 ticket = createObject(u'waeup.CourseTicket') 57 ticket.automatic = True 58 ticket.mandatory = val.mandatory 59 ticket.carry_over = False 60 self.addCourseTicket(ticket, val.course) 61 return 39 62 40 63 CustomStudentStudyLevel = attrs_to_fields(CustomStudentStudyLevel)
Note: See TracChangeset for help on using the changeset viewer.