Changeset 9359 for main/waeup.futminna
- Timestamp:
- 19 Oct 2012, 16:29:59 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.futminna/trunk/src/waeup/futminna/students/studycourse.py
r9351 r9359 22 22 import grok 23 23 from zope.interface import implementedBy 24 from waeup.kofa.students.studycourse import ( 25 StudentStudyCourse, StudentStudyCourseFactory) 24 from waeup.kofa.students.studycourse import StudentStudyCourseFactory 26 25 from waeup.kofa.utils.helpers import attrs_to_fields 27 26 from waeup.kofa.students.interfaces import IStudentNavigation 28 27 from waeup.kofa.students.workflow import CLEARED, RETURNING, PAID 28 from kofacustom.nigeria.students.studycourse import NigeriaStudentStudyCourse 29 29 from waeup.futminna.students.interfaces import ICustomStudentStudyCourse 30 30 31 class CustomStudentStudyCourse( StudentStudyCourse):31 class CustomStudentStudyCourse(NigeriaStudentStudyCourse): 32 32 """This is a container for study levels. 33 33 """ 34 35 34 grok.implements(ICustomStudentStudyCourse, IStudentNavigation) 36 35 grok.provides(ICustomStudentStudyCourse) 37 38 @property39 def next_session_allowed(self):40 state = self.student.state41 certificate = getattr(self, 'certificate', None)42 if certificate == None:43 return False44 if state == CLEARED:45 return True46 cond0 = state == RETURNING47 cond1 = self.current_verdict in (48 'A','B','C','F','J','L','M','N','O','X','Z')49 cond2 = self.current_level in (0, 100)50 cond3 = certificate.study_mode.startswith('de') and \51 self.current_level == 20052 cond4 = certificate.study_mode.startswith('ph') and \53 self.current_level == 30054 if cond0 and (cond1 or cond2 or cond3 or cond4):55 return True56 cond5 = self.is_postgrad57 cond6 = state == PAID58 if cond5 and cond6:59 return True60 return False61 36 62 37 CustomStudentStudyCourse = attrs_to_fields(CustomStudentStudyCourse)
Note: See TracChangeset for help on using the changeset viewer.