Changeset 3705
- Timestamp:
- 2 Oct 2008, 09:10:57 (16 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/CHANGES.txt
r3701 r3705 50 50 ----------------- 51 51 - Add academic and pastoral report slips 52 53 1.9 (2008-10-02) 54 ----------------- 55 - add Uniben profile (was default profile) 56 - enable transfer students import 57 58 Two files must be imported for creating new transfer student records: 59 60 1. transferred_from_XX.csv: id, matric_no = 'transferred', import_mode = 'edit' 61 62 2. transferred_to_XX.csv: entry_mode = 'transfer', import_mode = 'create', reg_transition = 'return', 63 all fields from students_catalog except id and edited according to new study course -
WAeUP_SRP/trunk/WAeUPImport.py
r3549 r3705 766 766 jamb_reg_no = mapping.get('jamb_reg_no',None) 767 767 matric_no = mapping.get('matric_no',None) 768 entry_mode = mapping.get('entry_mode',None) 768 769 msg = '' 769 770 student_id = mapping.get('id',None) … … 772 773 msg = "student_id must not be specified in create mode" 773 774 break 774 if jamb_reg_no :775 if jamb_reg_no and not entry_mode == 'transfer': 775 776 res = self.students_catalog(jamb_reg_no = jamb_reg_no) 776 777 if res: … … 846 847 student_record = res[0] 847 848 if matric_no and student_record.matric_no: 848 if matric_no != student_record.matric_no :849 if matric_no != student_record.matric_no and not matric_no == 'transferred': 849 850 res = self.students_catalog(matric_no = matric_no) 850 851 if res: … … 1137 1138 ###) 1138 1139 1139 def create_old(self,mapping): ###( 1140 "edit student verdicts and create StudentStudyLevel object if not existent" 1140 1141 def edit(self,mapping): ###( 1142 "edit student verdicts" 1141 1143 wftool = self.portal_workflow 1142 1144 logger = logging.getLogger('WAeUPTool.mass_edit_verdict') … … 1145 1147 matric_no = mapping.get('matric_no',None) 1146 1148 editable_keys = mapping.keys() 1147 while True: 1148 key = '' 1149 key = '' 1150 while True: 1151 result = self.findStudent('edit',student_id=student_id,matric_no=matric_no) 1152 #student_record,msg = self.getStudentRecord(mapping) 1153 msg = result['msg'] 1154 if msg: 1155 break 1156 student_record = result['student_record'] 1157 key_used = result['key_used'] 1158 if key_used in editable_keys: 1159 editable_keys.remove(key_used) 1160 student_id = student_record.id 1161 mapping['id'] = student_id 1162 d = {} 1163 #import pdb;pdb.set_trace() 1164 any_change = False 1165 #special treatment for StudentStudyLevel 1166 current_session = d['session'] = mapping.get('current_session','') 1167 if current_session and student_record.session != current_session: 1168 msg = 'student %s: imported session %s does not match current_session %s' % (student_id, 1169 current_session, 1170 student_record.session) 1171 break 1172 current_level = mapping.get('current_level','') 1173 if not current_level.isdigit(): 1174 msg = 'student %s: imported level is empty' % (student_id,) 1175 break 1176 if current_level and student_record.level != current_level: 1177 msg = 'student %s: imported level %s does not match current_level %s' % (student_id, 1178 current_level, 1179 student_record.level) 1180 break 1181 student_review_state = student_record.review_state 1182 if student_review_state == 'deactivated': 1183 msg = "student %s in review_state %s" % (student_id, student_review_state) 1184 break 1185 if student_review_state not in ('courses_validated','returning'): 1186 msg = "student %s in wrong review_state %s" % (student_id, student_review_state) 1187 break 1188 student_obj = getattr(students_folder,student_id) 1189 # f2t = self.field2types_student 1190 study_course_obj = getattr(student_obj,'study_course',None) 1191 if study_course_obj is None: 1192 msg = 'student %s: no study_course object' % student_id 1193 break 1194 level_obj = getattr(study_course_obj,current_level,None) 1195 if level_obj is None: 1196 msg = 'student %s: no study_level object for level %s' % (student_id, 1197 current_level) 1198 break 1199 verdict = d['verdict'] = d['current_verdict'] = mapping.get('current_verdict','') 1200 1201 #if verdict == student_record.verdict: 1202 # msg = 'student %s: verdict already set to %s' % (student_id, 1203 # verdict) 1204 1205 level_review_state = wftool.getInfoFor(level_obj,'review_state',None) 1206 if level_review_state != "closed": 1207 wftool.doActionFor(level_obj,'close') 1208 # msg = 'student %s: level %s is not closed' % (student_id, 1209 # current_level) 1210 1211 study_course_obj.getContent().edit(mapping = d) 1212 level_obj.getContent().edit(mapping = d) 1213 if student_review_state != "returning": 1214 wftool.doActionFor(student_obj,'return') 1215 # try: 1216 # wftool.doActionFor(level_obj,'close') 1217 # except: 1218 # pass 1219 break 1220 return student_id,msg,mapping 1221 ###) 1222 1223 def edit_old(self,mapping): ###( 1224 "edit student verdicts" 1225 wftool = self.portal_workflow 1226 logger = logging.getLogger('WAeUPTool.mass_edit_verdict') 1227 students_folder = self.portal_url.getPortalObject().campus.students 1228 student_id = mapping.get('id',None) 1229 matric_no = mapping.get('matric_no',None) 1230 editable_keys = mapping.keys() 1231 key = '' 1232 while True: 1149 1233 msg = '' 1150 1234 if student_id: … … 1205 1289 break 1206 1290 level_obj = getattr(study_course_obj,current_level,None) 1207 1208 1291 if level_obj is None: 1209 # The only difference to the edit method is that we create a StudentStudyLevel object 1210 try: 1211 study_course_obj.invokeFactory('StudentStudyLevel',"%s" % current_level) 1212 level_obj = getattr(context,"%s" % current_level) 1213 level_obj.portal_workflow.doActionFor(level,'open') 1214 except: 1215 continue 1216 #msg = 'student %s: no study_level object for level %s' % (student_id, 1217 # current_level) 1218 #break 1219 1292 msg = 'student %s: no study_level object for level %s' % (student_id, 1293 current_level) 1294 break 1220 1295 verdict = d['verdict'] = d['current_verdict'] = mapping.get('current_verdict','') 1221 1296 … … 1241 1316 return student_id,msg,mapping 1242 1317 ###) 1243 1244 def edit(self,mapping): ###(1245 "edit student verdicts"1246 wftool = self.portal_workflow1247 logger = logging.getLogger('WAeUPTool.mass_edit_verdict')1248 students_folder = self.portal_url.getPortalObject().campus.students1249 student_id = mapping.get('id',None)1250 matric_no = mapping.get('matric_no',None)1251 editable_keys = mapping.keys()1252 key = ''1253 while True:1254 result = self.findStudent('edit',student_id=student_id,matric_no=matric_no)1255 #student_record,msg = self.getStudentRecord(mapping)1256 msg = result['msg']1257 if msg:1258 break1259 student_record = result['student_record']1260 key_used = result['key_used']1261 if key_used in editable_keys:1262 editable_keys.remove(key_used)1263 student_id = student_record.id1264 mapping['id'] = student_id1265 d = {}1266 #import pdb;pdb.set_trace()1267 any_change = False1268 #special treatment for StudentStudyLevel1269 current_session = d['session'] = mapping.get('current_session','')1270 if current_session and student_record.session != current_session:1271 msg = 'student %s: imported session %s does not match current_session %s' % (student_id,1272 current_session,1273 student_record.session)1274 break1275 current_level = mapping.get('current_level','')1276 if not current_level.isdigit():1277 msg = 'student %s: imported level is empty' % (student_id,)1278 break1279 if current_level and student_record.level != current_level:1280 msg = 'student %s: imported level %s does not match current_level %s' % (student_id,1281 current_level,1282 student_record.level)1283 break1284 student_review_state = student_record.review_state1285 if student_review_state == 'deactivated':1286 msg = "student %s in review_state %s" % (student_id, student_review_state)1287 break1288 if student_review_state not in ('courses_validated','returning'):1289 msg = "student %s in wrong review_state %s" % (student_id, student_review_state)1290 break1291 student_obj = getattr(students_folder,student_id)1292 # f2t = self.field2types_student1293 study_course_obj = getattr(student_obj,'study_course',None)1294 if study_course_obj is None:1295 msg = 'student %s: no study_course object' % student_id1296 break1297 level_obj = getattr(study_course_obj,current_level,None)1298 if level_obj is None:1299 msg = 'student %s: no study_level object for level %s' % (student_id,1300 current_level)1301 break1302 verdict = d['verdict'] = d['current_verdict'] = mapping.get('current_verdict','')1303 1304 #if verdict == student_record.verdict:1305 # msg = 'student %s: verdict already set to %s' % (student_id,1306 # verdict)1307 1308 level_review_state = wftool.getInfoFor(level_obj,'review_state',None)1309 if level_review_state != "closed":1310 wftool.doActionFor(level_obj,'close')1311 # msg = 'student %s: level %s is not closed' % (student_id,1312 # current_level)1313 1314 study_course_obj.getContent().edit(mapping = d)1315 level_obj.getContent().edit(mapping = d)1316 if student_review_state != "returning":1317 wftool.doActionFor(student_obj,'return')1318 # try:1319 # wftool.doActionFor(level_obj,'close')1320 # except:1321 # pass1322 break1323 return student_id,msg,mapping1324 ###)1325 1326 def edit_old(self,mapping): ###(1327 "edit student verdicts"1328 wftool = self.portal_workflow1329 logger = logging.getLogger('WAeUPTool.mass_edit_verdict')1330 students_folder = self.portal_url.getPortalObject().campus.students1331 student_id = mapping.get('id',None)1332 matric_no = mapping.get('matric_no',None)1333 editable_keys = mapping.keys()1334 key = ''1335 while True:1336 msg = ''1337 if student_id:1338 student_record = self.students_catalog.getRecordByKey(student_id)1339 if student_record is None:1340 #return '',"no student with id %s" % student_id1341 msg = "no student with id %s" % student_id1342 break1343 if matric_no and student_record.matric_no and matric_no != student_record.matric_no:1344 msg = 'student %s: matric_no %s does not match %s' % (student_record.id,1345 student_record.matric_no,1346 matric_no)1347 break1348 mapping['matric_no'] = student_record.matric_no1349 elif matric_no:1350 res = self.students_catalog(matric_no = matric_no)1351 if not res:1352 msg = "no student with matric_no %s" % matric_no1353 break1354 student_record = res[0]1355 editable_keys.remove('matric_no')1356 else:1357 msg = "no id or matric_no specified"1358 break1359 student_id = student_record.id1360 mapping['id'] = student_id1361 d = {}1362 #import pdb;pdb.set_trace()1363 any_change = False1364 #special treatment for StudentStudyLevel1365 current_session = d['session'] = mapping.get('current_session','')1366 if current_session and student_record.session != current_session:1367 msg = 'student %s: imported session %s does not match current_session %s' % (student_id,1368 current_session,1369 student_record.session)1370 break1371 current_level = mapping.get('current_level','')1372 if not current_level.isdigit():1373 msg = 'student %s: imported level is empty' % (student_id,)1374 break1375 if current_level and student_record.level != current_level:1376 msg = 'student %s: imported level %s does not match current_level %s' % (student_id,1377 current_level,1378 student_record.level)1379 break1380 student_review_state = student_record.review_state1381 if student_review_state == 'deactivated':1382 msg = "student %s in review_state %s" % (student_id, student_review_state)1383 break1384 if student_review_state not in ('courses_validated','returning'):1385 msg = "student %s in wrong review_state %s" % (student_id, student_review_state)1386 break1387 student_obj = getattr(students_folder,student_id)1388 # f2t = self.field2types_student1389 study_course_obj = getattr(student_obj,'study_course',None)1390 if study_course_obj is None:1391 msg = 'student %s: no study_course object' % student_id1392 break1393 level_obj = getattr(study_course_obj,current_level,None)1394 if level_obj is None:1395 msg = 'student %s: no study_level object for level %s' % (student_id,1396 current_level)1397 break1398 verdict = d['verdict'] = d['current_verdict'] = mapping.get('current_verdict','')1399 1400 #if verdict == student_record.verdict:1401 # msg = 'student %s: verdict already set to %s' % (student_id,1402 # verdict)1403 1404 level_review_state = wftool.getInfoFor(level_obj,'review_state',None)1405 if level_review_state != "closed":1406 wftool.doActionFor(level_obj,'close')1407 # msg = 'student %s: level %s is not closed' % (student_id,1408 # current_level)1409 1410 study_course_obj.getContent().edit(mapping = d)1411 level_obj.getContent().edit(mapping = d)1412 if student_review_state != "returning":1413 wftool.doActionFor(student_obj,'return')1414 # try:1415 # wftool.doActionFor(level_obj,'close')1416 # except:1417 # pass1418 break1419 return student_id,msg,mapping1420 ###)1421 1318 ###) -
WAeUP_SRP/trunk/WAeUPTool.py
r3681 r3705 971 971 self.with_timing = with_timing 972 972 973 if brain.screening_type in ('cest','sandwich',): 974 reg_no = "%s%s/%s" % (brain.course1[:3],brain.serial,brain.entry_session) 975 else: 976 reg_no = brain.reg_no 977 973 978 #ignore argument entry_session 974 979 if not brain.entry_session: … … 979 984 self._v_certificates = self.getCertificatesDict() 980 985 students_folder = self.portal_url.getPortalObject().campus.students 981 if brain.screening_type in ('cest','sandwich',): 982 reg_no = "%s%s/%s" % (brain.course1[:3],brain.serial,brain.entry_session) 983 else: 984 reg_no = brain.reg_no 986 985 987 res = self.students_catalog(jamb_reg_no = reg_no) 986 988 if res: -
WAeUP_SRP/trunk/__init__.py
r3689 r3705 113 113 'default', 114 114 'WAeUP_SRP', 115 "WAeUP Default Profile (Uniben)",115 "WAeUP Default Profile", 116 116 'profiles/default', 117 117 'WAeUP_SRP', … … 119 119 for_=ICPSSite) 120 120 profile_registry.registerProfile( 121 'uniben', 122 'WAeUP Uniben Profile', 123 "University of Benin", 124 'profiles/uniben', 125 'WAeUP_SRP', 126 BASE, 127 for_=ICPSSite) 128 profile_registry.registerProfile( 121 129 'fceokene', 122 ' FCE Okene Profile',130 'WAeUP FCE Okene Profile', 123 131 "Federal College of Education", 124 132 'profiles/fceokene', … … 128 136 profile_registry.registerProfile( 129 137 'aaua', 130 ' AAUA Profile',138 'WAeUP AAUA Profile', 131 139 "Adekunle Ajasin University", 132 140 'profiles/aaua', … … 136 144 profile_registry.registerProfile( 137 145 'unilorin', 138 ' Unilorin Profile',146 'WAeUP Unilorin Profile', 139 147 "University of Ilorin", 140 148 'profiles/unilorin', … … 144 152 profile_registry.registerProfile( 145 153 'ois', 146 ' OIS Profile',154 'WAeUP OIS Profile', 147 155 "Olashore International School", 148 156 'profiles/ois', -
WAeUP_SRP/trunk/profiles/uniben/vocabularies/entry_modes.xml
r3692 r3705 18 18 <item key="ct_ft" msgid="">Certificate Full Time</item> 19 19 <item key="ct_pt" msgid="">Certificate Part Time</item> 20 <item key="transfer" msgid="">Transfer Student</item> 20 21 </object>
Note: See TracChangeset for help on using the changeset viewer.