- Timestamp:
- 19 Oct 2012, 16:29:35 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/studycourse.py
r9354 r9357 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.aaue.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 36 38 @property 39 def next_session_allowed(self): 40 state = self.student.state 41 certificate = getattr(self, 'certificate', None) 42 if certificate == None: 43 return False 44 if state == CLEARED: 45 return True 46 cond0 = state == RETURNING 47 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 == 200 52 cond4 = certificate.study_mode.startswith('ph') and \ 53 self.current_level == 300 54 if cond0 and (cond1 or cond2 or cond3 or cond4): 55 return True 56 cond5 = self.is_postgrad 57 cond6 = state == PAID 58 if cond5 and cond6: 59 return True 60 return False 37 61 38 62 39 CustomStudentStudyCourse = attrs_to_fields(CustomStudentStudyCourse)
Note: See TracChangeset for help on using the changeset viewer.