- Timestamp:
- 12 Mar 2012, 08:04:03 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/interfaces.py
r7837 r7841 83 83 84 84 def getValues(self): 85 subjects_dict = getUtility(IKofaUtils). getExamSubjectsDict()85 subjects_dict = getUtility(IKofaUtils).EXAM_SUBJECTS_DICT 86 86 return sorted(subjects_dict.keys()) 87 87 88 88 def getTitle(self, value): 89 subjects_dict = getUtility(IKofaUtils). getExamSubjectsDict()89 subjects_dict = getUtility(IKofaUtils).EXAM_SUBJECTS_DICT 90 90 return "%s:" % subjects_dict[value] 91 91 … … 93 93 94 94 def getValues(self): 95 grades_dict = getUtility(IKofaUtils). getExamGradesDict()95 grades_dict = getUtility(IKofaUtils).EXAM_GRADES_DICT 96 96 return sorted(grades_dict.keys()) 97 97 98 98 def getTitle(self, value): 99 grades_dict = getUtility(IKofaUtils). getExamGradesDict()99 grades_dict = getUtility(IKofaUtils).EXAM_GRADES_DICT 100 100 return grades_dict[value] 101 101 … … 189 189 """ 190 190 191 def storage(): 192 """Return the initial storage path of the data center. 193 """ 191 PORTAL_LANGUAGE = Attribute("Dict of global language setting") 192 PREFERRED_LANGUAGES_DICT = Attribute("Dict of preferred languages") 193 EXAM_SUBJECTS_DICT = Attribute("Dict of examination subjects") 194 EXAM_GRADES_DICT = Attribute("Dict of examination grades") 195 INST_TYPES_DICT = Attribute("Dict if institution types") 196 STUDY_MODES_DICT = Attribute("Dict of study modes") 197 APP_CATS_DICT = Attribute("Dict of application categories") 198 SEMESTER_DICT = Attribute("Dict of semesters or trimesters") 194 199 195 200 def sendContactForm( … … 214 219 def genPassword(length, chars): 215 220 """Generate a random password. 216 """217 218 def getVerdictsDict():219 """Provide a dict of verdicts.220 221 """ 221 222 -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r7834 r7841 552 552 def current_mode(self): 553 553 if self.context.certificate is not None: 554 studymodes_dict = getUtility(IKofaUtils). getStudyModesDict()554 studymodes_dict = getUtility(IKofaUtils).STUDY_MODES_DICT 555 555 return studymodes_dict[self.context.certificate.study_mode] 556 556 return -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r7819 r7841 40 40 """ 41 41 def getValues(self, context): 42 verdicts_dict = getUtility(IStudentsUtils). getVerdictsDict()42 verdicts_dict = getUtility(IStudentsUtils).VERDICTS_DICT 43 43 return verdicts_dict.keys() 44 44 … … 47 47 48 48 def getTitle(self, context, value): 49 verdicts_dict = getUtility(IStudentsUtils). getVerdictsDict()49 verdicts_dict = getUtility(IStudentsUtils).VERDICTS_DICT 50 50 return verdicts_dict[value] 51 51 … … 55 55 56 56 """ 57 def setReturningData(student): 58 """ This method defines what happens after school fee payment 59 depending on the student's senate verdict. 60 61 In the base configuration current level is always increased 62 by 100 no matter which verdict has been assigned. 63 """ 64 57 65 def getPaymentDetails(category, student): 58 66 """Get the payment dates of a student for the payment category -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r7819 r7841 177 177 178 178 def setReturningData(self, student): 179 """ This method defines what happens after school fee payment 180 depending on the student's senate verdict. 181 182 In the base configuration current level is always increased 183 by 100 no matter which verdict has been assigned. 184 """ 179 185 student['studycourse'].current_level += 100 180 186 student['studycourse'].current_session += 1 … … 185 191 186 192 def getPaymentDetails(self, category, student): 193 """Get the payment dates of a student for the payment category 194 specified. 195 """ 187 196 d = {} 188 197 d['p_item'] = u'' … … 211 220 212 221 def getAccommodationDetails(self, student): 222 """Determine the accommodation dates of a student. 223 """ 213 224 d = {} 214 225 d['error'] = u'' … … 238 249 return d 239 250 240 # In the standard configuration we select the first bed found,241 # but can also randomize the selection if we like.242 251 def selectBed(self, available_beds): 252 """Select a bed from a list of available beds. 253 254 In the base configuration we select the first bed found, 255 but can also randomize the selection if we like. 256 """ 243 257 return available_beds[0] 244 258 245 259 def renderPDF(self, view, filename='slip.pdf', 246 260 student=None, studentview=None, tableheader=None, tabledata=None): 261 """Render pdf slips for various pages. 262 """ 247 263 # (0,0),(-1,-1) = whole table 248 264 # (0,0),(0,-1) = first column … … 361 377 return pdf.getpdfdata() 362 378 363 def getVerdictsDict(self): 364 """Provide a dictionary of verdicts. 365 """ 366 return { 367 '0': 'not yet', 368 'A': 'Successful student', 369 'B': 'Student with carryover courses', 370 'C': 'Student on probation', 371 'D': 'Withdrawn from the faculty', 372 'E': 'Student who were previously on probation', 373 'F': 'Medical case', 374 'G': 'Absent from examination', 375 'H': 'Withheld results', 376 'I': 'Expelled/rusticated/suspended student', 377 'J': 'Temporary withdrawn from the university', 378 'K': 'Unregistered student', 379 'L': 'Referred student', 380 'M': 'Reinstatement', 381 'N': 'Student on transfer', 382 'O': 'NCE-III repeater', 383 'Y': 'No previous verdict', 384 'X': 'New 300 level student', 385 'Z': 'Successful student (provisional)', 386 'A1': 'First Class', 387 'A2': 'Second Class Upper', 388 'A3': 'Second Class Lower', 389 'A4': 'Third Class', 390 'A5': 'Pass', 391 'A6': 'Distinction', 392 'A7': 'Credit', 393 'A8': 'Merit', 394 } 379 VERDICTS_DICT = { 380 '0': 'not yet', 381 'A': 'Successful student', 382 'B': 'Student with carryover courses', 383 'C': 'Student on probation', 384 'D': 'Withdrawn from the faculty', 385 'E': 'Student who were previously on probation', 386 'F': 'Medical case', 387 'G': 'Absent from examination', 388 'H': 'Withheld results', 389 'I': 'Expelled/rusticated/suspended student', 390 'J': 'Temporary withdrawn from the university', 391 'K': 'Unregistered student', 392 'L': 'Referred student', 393 'M': 'Reinstatement', 394 'N': 'Student on transfer', 395 'O': 'NCE-III repeater', 396 'Y': 'No previous verdict', 397 'X': 'New 300 level student', 398 'Z': 'Successful student (provisional)', 399 'A1': 'First Class', 400 'A2': 'Second Class Upper', 401 'A3': 'Second Class Lower', 402 'A4': 'Third Class', 403 'A5': 'Pass', 404 'A6': 'Distinction', 405 'A7': 'Credit', 406 'A8': 'Merit', 407 } -
main/waeup.kofa/trunk/src/waeup/kofa/university/department.py
r7819 r7841 73 73 74 74 def longtitle(self): 75 insttypes_dict = getUtility(IKofaUtils). getInstTypeDict()75 insttypes_dict = getUtility(IKofaUtils).INST_TYPES_DICT 76 76 return "%s %s (%s)" % ( 77 77 insttypes_dict[self.title_prefix], -
main/waeup.kofa/trunk/src/waeup/kofa/university/faculty.py
r7819 r7841 61 61 62 62 def longtitle(self): 63 insttypes_dict = getUtility(IKofaUtils). getInstTypeDict()63 insttypes_dict = getUtility(IKofaUtils).INST_TYPES_DICT 64 64 result = "%s %s (%s)" % ( 65 65 insttypes_dict[self.title_prefix], -
main/waeup.kofa/trunk/src/waeup/kofa/university/vocabularies.py
r7838 r7841 46 46 # see sources below 47 47 from waeup.kofa.interfaces import IKofaUtils 48 return getUtility(IKofaUtils). getSemesterDict().keys()48 return getUtility(IKofaUtils).SEMESTER_DICT.keys() 49 49 except: 50 50 return [9] … … 56 56 try: 57 57 from waeup.kofa.interfaces import IKofaUtils 58 semesters_dict = getUtility(IKofaUtils). getSemesterDict()58 semesters_dict = getUtility(IKofaUtils).SEMESTER_DICT 59 59 return semesters_dict[value] 60 60 except: … … 66 66 """ 67 67 def getValues(self, context): 68 insttypes_dict = getUtility(IKofaUtils). getInstTypeDict()68 insttypes_dict = getUtility(IKofaUtils).INST_TYPES_DICT 69 69 return sorted(insttypes_dict.keys()) 70 70 … … 73 73 74 74 def getTitle(self, context, value): 75 insttypes_dict = getUtility(IKofaUtils). getInstTypeDict()75 insttypes_dict = getUtility(IKofaUtils).INST_TYPES_DICT 76 76 return insttypes_dict[value] 77 77 … … 81 81 """ 82 82 def getValues(self, context): 83 appcats_dict = getUtility(IKofaUtils). getAppCatDict()83 appcats_dict = getUtility(IKofaUtils).APP_CATS_DICT 84 84 return sorted(appcats_dict.keys()) 85 85 … … 88 88 89 89 def getTitle(self, context, value): 90 appcats_dict = getUtility(IKofaUtils). getAppCatDict()90 appcats_dict = getUtility(IKofaUtils).APP_CATS_DICT 91 91 return appcats_dict[value] 92 92 … … 96 96 """ 97 97 def getValues(self, context): 98 studymodes_dict = getUtility(IKofaUtils). getStudyModesDict()98 studymodes_dict = getUtility(IKofaUtils).STUDY_MODES_DICT 99 99 return sorted(studymodes_dict.keys()) 100 100 … … 103 103 104 104 def getTitle(self, context, value): 105 studymodes_dict = getUtility(IKofaUtils). getStudyModesDict()105 studymodes_dict = getUtility(IKofaUtils).STUDY_MODES_DICT 106 106 return studymodes_dict[value] 107 107 -
main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py
r7836 r7841 57 57 } 58 58 59 def getExamSubjectsDict(self): 60 """Provide a dictionary of exam subjects. 61 """ 62 return { 63 'accounts': 'Accounts', 64 'add_general_science': 'Add General Science', 65 'add_maths': 'Add Maths', 66 'agricultural_science': 'Agricultural Science', 67 'applied_electricity': 'Applied Electricity', 68 'arabi': 'Arabic', 69 'arithmetics': 'Arithmetics', 70 'art': 'Art', 71 'auto_mechanics': 'Auto Mechanics', 72 'basic_electricity': 'Basic Electricity', 73 'bible_knowledge': 'Bible Knowledge', 74 'biology': 'Biology', 75 'biology_alt_syl': 'Biology (Alt.Syl)', 76 'book_keeping': 'Book Keeping', 77 'building_construction': 'Building Construction', 78 'business_management': 'Business Management', 79 'business_construction_management': 'Business/Construction Management (Adv)', 80 'chemistry': 'Chemistry', 81 'chemistry_alt_syl': 'Chemistry (Alt.Syl)', 82 'christian_religious_studies': 'Christian Religious Studies', 83 'clerical_office_duties': 'Clerical Office Duties', 84 'clothing_and_textiles': 'Clothing and Textiles', 85 'commerce': 'Commerce', 86 'economics': 'Economics', 87 'education': 'Education', 88 'efik': 'Efik', 89 'electronics': 'Electronics', 90 'elementary_surveying': 'Elementary Surveying', 91 'english_language': 'English Language', 92 'engineering_science': 'Engineering Science', 93 'financial_accounting': 'Financial Accounting', 94 'food_and_nutrition': 'Food and Nutrition', 95 'french': 'French', 96 'further_mathematics': 'Further Mathematics', 97 'general_science': 'General Science', 98 'geography': 'Geography', 99 'german': 'German', 100 'government': 'Government', 101 'hausa': 'Hausa', 102 'hausa_literature': 'Hausa Literature', 103 'health_science': 'Health Science', 104 'history': 'History', 105 'home_management': 'Home Management', 106 'industrial_electrical_installation': 'Industrial Elect Installation (Adv)', 107 'intergrated_science': 'Intergrated Science', 108 'islamic_studies': 'Islamic Studies', 109 'literature_in_english': 'Literature in English', 110 'literature_in_nigerian_languages': 'Literature in Nigerian Languages', 111 'igbo': 'Igbo', 112 'igbo_literature': 'Igbo Literature', 113 'yoruba': 'Yoruba', 114 'yoruba_literature': 'Yoruba Literature', 115 'management_in_living': 'Management in Living', 116 'mathematics': 'Mathematics', 117 'metalwork': 'Metalwork', 118 'music': 'Music', 119 'nigerian_language': 'Nigerian Language', 120 'office_practice': 'Office Practice', 121 'physical_education': 'Physical Education', 122 'physical_health_education': 'Physical and Health Education', 123 'physics': 'Physics', 124 'physics_alt_syl': 'Physics (Alt.Syl)', 125 'principles_of_cost_accounting': 'Principles of Cost Accounting', 126 'rural_science': 'Rural Science', 127 'science': 'Science', 128 'secretarial_duties': 'Secretarial Duties', 129 'shorthand': 'Shorthand', 130 'sierra_leone_studies': 'Sierra Leone Studies', 131 'sierra_leone_languages': 'Sierra Leone Languages', 132 'social_studies': 'Social Studies', 133 'statistics': 'Statistics', 134 'teaching_practice': 'Teaching Practice', 135 'technical_drawing': 'Technical Drawing', 136 'typewriting': 'Typewriting', 137 'visual_art': 'Visual Art', 138 'woodwork': 'Woodwork', 139 'winding_elect_machines': 'Winding of Elect Machines and Elect Eng Sc' 140 } 141 142 def getExamGradesDict(self): 143 """Provide a dictionary of exam grades. 144 """ 145 return { 146 'A1': 'Excellent (A1)', 147 'A2': 'Very Good (A2)', 148 'A3': 'Good (A3)', 149 'B2': 'Very Good (B2)', 150 'B3': 'Good (B3)', 151 'C4': 'Credit (C4)', 152 'C5': 'Credit (C5)', 153 'C6': 'Credit (C6)', 154 'D7': 'Pass (D7)', 155 'E8': 'Pass (E8)', 156 'F9': 'Fail (F9)', 157 'Aa': 'A (a)', 158 'Bb': 'B (b)', 159 'Cc': 'C (c)', 160 'Dd': 'D (d)', 161 'Ee': 'E (e)', 162 'Ff': 'F (f)', 163 'Gg': 'G (g)' 164 } 165 166 def getInstTypeDict(self): 167 """Provide a dictionary of study modes. 168 """ 169 return { 59 EXAM_SUBJECTS_DICT = { 60 'accounts': 'Accounts', 61 'add_general_science': 'Add General Science', 62 'add_maths': 'Add Maths', 63 'agricultural_science': 'Agricultural Science', 64 'applied_electricity': 'Applied Electricity', 65 'arabi': 'Arabic', 66 'arithmetics': 'Arithmetics', 67 'art': 'Art', 68 'auto_mechanics': 'Auto Mechanics', 69 'basic_electricity': 'Basic Electricity', 70 'bible_knowledge': 'Bible Knowledge', 71 'biology': 'Biology', 72 'biology_alt_syl': 'Biology (Alt.Syl)', 73 'book_keeping': 'Book Keeping', 74 'building_construction': 'Building Construction', 75 'business_management': 'Business Management', 76 'business_construction_management': 'Business/Construction Management (Adv)', 77 'chemistry': 'Chemistry', 78 'chemistry_alt_syl': 'Chemistry (Alt.Syl)', 79 'christian_religious_studies': 'Christian Religious Studies', 80 'clerical_office_duties': 'Clerical Office Duties', 81 'clothing_and_textiles': 'Clothing and Textiles', 82 'commerce': 'Commerce', 83 'economics': 'Economics', 84 'education': 'Education', 85 'efik': 'Efik', 86 'electronics': 'Electronics', 87 'elementary_surveying': 'Elementary Surveying', 88 'english_language': 'English Language', 89 'engineering_science': 'Engineering Science', 90 'financial_accounting': 'Financial Accounting', 91 'food_and_nutrition': 'Food and Nutrition', 92 'french': 'French', 93 'further_mathematics': 'Further Mathematics', 94 'general_science': 'General Science', 95 'geography': 'Geography', 96 'german': 'German', 97 'government': 'Government', 98 'hausa': 'Hausa', 99 'hausa_literature': 'Hausa Literature', 100 'health_science': 'Health Science', 101 'history': 'History', 102 'home_management': 'Home Management', 103 'industrial_electrical_installation': 'Industrial Elect Installation (Adv)', 104 'intergrated_science': 'Intergrated Science', 105 'islamic_studies': 'Islamic Studies', 106 'literature_in_english': 'Literature in English', 107 'literature_in_nigerian_languages': 'Literature in Nigerian Languages', 108 'igbo': 'Igbo', 109 'igbo_literature': 'Igbo Literature', 110 'yoruba': 'Yoruba', 111 'yoruba_literature': 'Yoruba Literature', 112 'management_in_living': 'Management in Living', 113 'mathematics': 'Mathematics', 114 'metalwork': 'Metalwork', 115 'music': 'Music', 116 'nigerian_language': 'Nigerian Language', 117 'office_practice': 'Office Practice', 118 'physical_education': 'Physical Education', 119 'physical_health_education': 'Physical and Health Education', 120 'physics': 'Physics', 121 'physics_alt_syl': 'Physics (Alt.Syl)', 122 'principles_of_cost_accounting': 'Principles of Cost Accounting', 123 'rural_science': 'Rural Science', 124 'science': 'Science', 125 'secretarial_duties': 'Secretarial Duties', 126 'shorthand': 'Shorthand', 127 'sierra_leone_studies': 'Sierra Leone Studies', 128 'sierra_leone_languages': 'Sierra Leone Languages', 129 'social_studies': 'Social Studies', 130 'statistics': 'Statistics', 131 'teaching_practice': 'Teaching Practice', 132 'technical_drawing': 'Technical Drawing', 133 'typewriting': 'Typewriting', 134 'visual_art': 'Visual Art', 135 'woodwork': 'Woodwork', 136 'winding_elect_machines': 'Winding of Elect Machines and Elect Eng Sc' 137 } 138 139 EXAM_GRADES_DICT = { 140 'A1': 'Excellent (A1)', 141 'A2': 'Very Good (A2)', 142 'A3': 'Good (A3)', 143 'B2': 'Very Good (B2)', 144 'B3': 'Good (B3)', 145 'C4': 'Credit (C4)', 146 'C5': 'Credit (C5)', 147 'C6': 'Credit (C6)', 148 'D7': 'Pass (D7)', 149 'E8': 'Pass (E8)', 150 'F9': 'Fail (F9)', 151 'Aa': 'A (a)', 152 'Bb': 'B (b)', 153 'Cc': 'C (c)', 154 'Dd': 'D (d)', 155 'Ee': 'E (e)', 156 'Ff': 'F (f)', 157 'Gg': 'G (g)' 158 } 159 160 INST_TYPES_DICT = { 170 161 'faculty': 'Faculty of', 171 162 'department': 'Department of', … … 177 168 } 178 169 179 def getStudyModesDict(self): 180 """Provide a dictionary of study modes. 181 """ 182 return { 170 STUDY_MODES_DICT = { 183 171 'rmd_ft': 'Remedial with deficiencies', 184 172 'dp_pt': 'Diploma Part Time', … … 200 188 } 201 189 202 def getAppCatDict(self): 203 """Provide a dictionary of study modes. 204 """ 205 return { 190 APP_CATS_DICT = { 206 191 'basic': 'PUME, PDE, PCE, PRENCE', 207 192 'no': 'no application', … … 211 196 } 212 197 213 def getSemesterDict(self): 214 """Provide a dictionary of semester or trimester types. 215 """ 216 return { 198 SEMESTER_DICT = { 217 199 1: 'First Semester', 218 200 2: 'Second Semester',
Note: See TracChangeset for help on using the changeset viewer.