Changeset 1727
- Timestamp:
- 2 May 2007, 20:22:26 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/WAeUPTables.py
r1725 r1727 485 485 student_brain = students[i] 486 486 spath = student_brain.getPath() 487 student_obj = student_brain.getObject()487 student_object = student_brain.getObject() 488 488 data = {} 489 489 sid = data['id'] = student_brain.getId … … 496 496 sub_objects = True 497 497 except: 498 #from pdb import set_trace;set_trace() 498 499 continue 499 500 for field in self.affected_types[pt]['fields']: … … 501 502 data[field] = getattr(self,'get_from_doc_%s' % field)(doc) 502 503 else: 503 data[field] = getattr(doc,field) 504 #from pdb import set_trace;set_trace() 505 if not sub_objects and noattr: 504 data[field] = getattr(doc,field,None) 505 if not sub_objects: 506 506 import_res = self.returning_import(id = sid) 507 507 if not import_res: … … 514 514 import_record.Lastname) 515 515 data['matric_no'] = import_record.Entryregno 516 study_course = getattr(student_obj,'study_course',None) 517 current_level = data.get('level',None) 518 data['registered_courses'] = [] 519 if study_course and current_level and current_level in study_course.objectIds(): 520 level_obj = getattr(study_course,current_level) 521 courses = [] 522 for c in level_obj.objectIds(): 523 if c.endswith('_co'): 524 courses.append(c[:-3]) 525 else: 526 courses.append(c) 527 data['registered_courses'] = courses 516 else: 517 study_course = getattr(student_object,'study_course',None) 518 current_level = data.get('level',None) 519 data['registered_courses'] = [] 520 if study_course and current_level and current_level in study_course.objectIds(): 521 level_obj = getattr(study_course,current_level) 522 courses = [] 523 for c in level_obj.objectIds(): 524 if c.endswith('_co'): 525 courses.append(c[:-3]) 526 else: 527 courses.append(c) 528 data['registered_courses'] = courses 528 529 self.addRecord(**data) 529 530 if pghandler: pghandler.finish()
Note: See TracChangeset for help on using the changeset viewer.