Changeset 7620 for main/waeup.sirp/trunk
- Timestamp:
- 9 Feb 2012, 19:29:24 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py
r7619 r7620 17 17 ## 18 18 from datetime import datetime 19 from zope.component import getUtility 19 20 from zope.interface import Attribute, Interface 20 21 from zope import schema 22 from zc.sourcefactory.contextual import BasicContextualSourceFactory 21 23 from waeup.sirp.interfaces import ( 22 24 ISIRPObject, academic_sessions_vocab, validate_email) … … 24 26 from waeup.sirp.university.vocabularies import CourseSource, study_modes 25 27 from waeup.sirp.students.vocabularies import ( 26 CertificateSource, VerdictSource,StudyLevelSource,28 CertificateSource, StudyLevelSource, 27 29 contextual_reg_num_source, contextual_mat_num_source, 28 30 GenderSource, nats_vocab, 29 31 ) 30 32 from waeup.sirp.payments.interfaces import IPaymentsContainer, IOnlinePayment 33 34 # VerdictSource can't be placed into the vocabularies module because it 35 # requires importing IStudentsUtils which then leads to circular imports. 36 class VerdictSource(BasicContextualSourceFactory): 37 """A verdicts source delivers all verdicts provided 38 in the portal. 39 """ 40 def getValues(self, context): 41 self.verdicts_dict = getUtility(IStudentsUtils).getVerdictsDict() 42 return self.verdicts_dict.keys() 43 44 def getToken(self, context, value): 45 return value 46 47 def getTitle(self, context, value): 48 return self.verdicts_dict[value] 31 49 32 50 class IStudentsUtils(Interface): -
main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py
r7615 r7620 338 338 'Content-Type', 'application/pdf') 339 339 return pdf.getpdfdata() 340 341 def getVerdictsDict(self): 342 """Provide a dictionary of verdicts. 343 """ 344 return { 345 'A1': 'First Class', 346 '0': 'not yet', 347 'A3': 'Second Class Lower', 348 'A2': 'Second Class Upper', 349 'A5': 'Pass', 350 'A4': 'Third Class', 351 'A7': 'Credit', 352 'A6': 'Distinction', 353 'A8': 'Merit', 354 'A': 'Successful student', 355 'C': 'Student on probation', 356 'B': 'Student with carryover courses', 357 'E': 'Student who were previously on probation', 358 'D': 'Withdrawn from the faculty', 359 'G': 'Absent from examination', 360 'F': 'Medical case', 361 'I': 'Expelled/rusticated/suspended student', 362 'H': 'Withheld results', 363 'K': 'Unregistered student', 364 'J': 'Temporary withdrawn from the university', 365 'M': 'Reinstatement', 366 'L': 'Referred student', 367 'O': 'NCE-III repeater', 368 'N': 'Student on transfer', 369 'Y': 'No previous verdict', 370 'X': 'New 300 level student', 371 'Z': 'Successful student (provisional)'} -
main/waeup.sirp/trunk/src/waeup/sirp/students/vocabularies.py
r7619 r7620 25 25 from zc.sourcefactory.basic import BasicSourceFactory 26 26 from zc.sourcefactory.contextual import BasicContextualSourceFactory 27 from waeup.sirp.interfaces import SimpleSIRPVocabulary , ISIRPUtils27 from waeup.sirp.interfaces import SimpleSIRPVocabulary 28 28 from waeup.sirp.students.lgas import LGAS 29 29 from waeup.sirp.students.nats import NATS … … 85 85 return "%s on %d. probation" % (title, repeat) 86 86 return title 87 88 class VerdictSource(BasicContextualSourceFactory):89 """A verdicts source delivers all verdicts provided90 in the portal.91 """92 93 def getValues(self, context):94 self.verdicts_dict = getUtility(ISIRPUtils).getVerdictsDict()95 return self.verdicts_dict.keys()96 97 def getToken(self, context, value):98 return value99 100 def getTitle(self, context, value):101 return self.verdicts_dict[value]102 87 103 88 class CertificateSource(BasicContextualSourceFactory): -
main/waeup.sirp/trunk/src/waeup/sirp/utils/utils.py
r7619 r7620 108 108 return send_mail( 109 109 from_name,from_addr,rcpt_name,rcpt_addr,subject,body,config) 110 111 112 def getVerdictsDict(self):113 """Provide a dictionary of verdicts.114 """115 return {116 'A1': 'First Class',117 '0': 'not yet',118 'A3': 'Second Class Lower',119 'A2': 'Second Class Upper',120 'A5': 'Pass',121 'A4': 'Third Class',122 'A7': 'Credit',123 'A6': 'Distinction',124 'A8': 'Merit',125 'A': 'Successful student',126 'C': 'Student on probation',127 'B': 'Student with carryover courses',128 'E': 'Student who were previously on probation',129 'D': 'Withdrawn from the faculty',130 'G': 'Absent from examination',131 'F': 'Medical case',132 'I': 'Expelled/rusticated/suspended student',133 'H': 'Withheld results',134 'K': 'Unregistered student',135 'J': 'Temporary withdrawn from the university',136 'M': 'Reinstatement',137 'L': 'Referred student',138 'O': 'NCE-III repeater',139 'N': 'Student on transfer',140 'Y': 'No previous verdict',141 'X': 'New 300 level student',142 'Z': 'Successful student (provisional)'}
Note: See TracChangeset for help on using the changeset viewer.