- Timestamp:
- 19 Feb 2008, 12:37:16 (17 years ago)
- Location:
- WAeUP_SRP/base
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/WAeUPImport.py
r3179 r3185 98 98 info['import_mode'] = mode 99 99 info['error'] = '' 100 info['digest'] = ''100 #info['digest'] = '' 101 101 self.info = info 102 102 self.csv_keys.extend(self.info) … … 644 644 students_folder = self.portal_url.getPortalObject().campus.students 645 645 jamb_reg_no = mapping.get('jamb_reg_no',None) 646 msg = '' 647 student_id = '' 648 while True: 646 matric_no = mapping.get('matric_no',None) 647 msg = '' 648 student_id = mapping.get('id',None) 649 while True: 650 if student_id: 651 msg = "student_id must not be specified in create mode" 652 break 649 653 if jamb_reg_no: 650 654 res = self.students_catalog(jamb_reg_no = jamb_reg_no) … … 652 656 msg = "jamb_reg_no exists" 653 657 break 654 matric_no = mapping.get('matric_no',None)655 658 if matric_no: 656 659 res = self.students_catalog(matric_no = matric_no) … … 658 661 msg = "matric_no exists" 659 662 break 663 if not (matric_no and jamb_reg_no): 664 msg = "jamb_reg_no or matric_no must be specified" 665 break 660 666 student_id = self.waeup_tool.generateStudentId('?') 661 667 students_folder.invokeFactory('Student', student_id) -
WAeUP_SRP/base/WAeUPTool.py
r3184 r3185 1483 1483 ds.getErrorMapping(k))) 1484 1484 error_count += 1 1485 if item.has_key('sex'): 1486 if item['sex']: 1487 item['sex'] = 'F' 1488 else: 1489 item['sex'] = 'M' 1485 1490 if error_string: 1486 1491 error = error_string … … 1490 1495 temp_item = item.copy() 1491 1496 temp_item.update(dm) 1492 results = importer.import_method(temp_item) 1497 import_method = importer.import_method 1498 if pending_only: 1499 import_mode = temp_item.get('import_mode','edit') 1500 import_method = getattr(importer, '%(import_mode)s' % vars() ) 1501 info['import_mode'] = import_mode 1502 results = import_method(temp_item) 1493 1503 id = results[0] 1494 1504 error = results[1]
Note: See TracChangeset for help on using the changeset viewer.