Changeset 1749
- Timestamp:
- 8 May 2007, 05:56:20 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Students.py
r1728 r1749 519 519 catalog_entry['level'] = '100' 520 520 dsc['study_course'] = cert_id 521 dsc['entry_level'] = '100'521 #dsc['entry_level'] = '100' 522 522 #dsc['entry_session'] = jamb.get(csv_d['session']) 523 523 study_course.getContent().edit(mapping=dsc) … … 546 546 wftool = self.portal_workflow 547 547 students_folder = self.portal_catalog({'meta_type': 'StudentsFolder'})[-1].getObject() 548 entry_levels = {'ume_ft':'100',549 'de_ft': '200',550 'ug_pt': '100',551 'de_pt': '200',552 'pg_ft': '700',553 'pg_pt': '700',554 'dp_pt': '100',555 'dp_ft': '100',548 #entry_levels = {'ume_ft':'100', 549 # 'de_ft': '200', 550 # 'ug_pt': '100', 551 # 'de_pt': '200', 552 # 'pg_ft': '700', 553 # 'pg_pt': '700', 554 # 'dp_pt': '100', 555 # 'dp_ft': '100', 556 556 } 557 557 csv_d = {'jamb_reg_no': "reg_no", … … 640 640 catalog_entry['email'] = da['app_email'] 641 641 catalog_entry['entry_mode'] = da['entry_mode'] 642 catalog_entry['entry_level'] = da["entry_level"] = entry_levels.get(da['entry_mode'],'100')642 #catalog_entry['entry_level'] = da["entry_level"] = entry_levels.get(da['entry_mode'],'100') 643 643 app = student.application 644 644 app_doc = app.getContent() … … 707 707 #catalog_entry['level'] = getattr(cert_doc,'start_level') 708 708 catalog_entry['session'] = dsc['current_session'] = da['entry_session'] 709 catalog_entry['level'] = dsc['current_level'] = entry_levels.get(da['entry_mode'],'100')709 #catalog_entry['level'] = dsc['current_level'] = entry_levels.get(da['entry_mode'],'100') 710 710 catalog_entry['mode'] = dsc['current_mode'] = da['entry_mode'] 711 711 catalog_entry['course'] = dsc['study_course'] = cert_id -
WAeUP_SRP/trunk/WAeUPTables.py
r1731 r1749 231 231 key = "id" 232 232 affected_types = { ###( 233 'StudentApplication': 233 'StudentApplication': 234 234 {'id': 'application', 235 235 'fields': 236 236 ('jamb_reg_no', 237 237 'entry_mode', 238 'entry_level',238 #'entry_level', 239 239 'entry_session', 240 240 ) … … 334 334 cm = getattr(doc,'current_mode',None) 335 335 return cm 336 336 337 337 338 338 def get_from_doc_session(self,doc): … … 385 385 if isinstance(name, str): 386 386 name = (name,) 387 reindextypes = {} 387 reindextypes = {} 388 388 reindex_special = [] 389 389 #import pdb;pdb.set_trace() … … 459 459 portal_type = "StudentCourseResult") 460 460 course_ids = [cr.getId for cr in result_brains] 461 courses = [] 461 courses = [] 462 462 for c in course_ids: 463 463 if c.endswith('_co'): … … 520 520 if study_course and current_level and current_level in study_course.objectIds(): 521 521 level_obj = getattr(study_course,current_level) 522 courses = [] 522 courses = [] 523 523 for c in level_obj.objectIds(): 524 524 if c.endswith('_co'): … … 526 526 else: 527 527 courses.append(c) 528 data['registered_courses'] = courses 528 data['registered_courses'] = courses 529 529 self.addRecord(**data) 530 530 if pghandler: pghandler.finish() … … 568 568 if not registered_courses: 569 569 level_obj = object.aq_parent 570 courses = [] 570 courses = [] 571 571 for c in level_obj.objectIds(): 572 572 if c.endswith('_co'): … … 575 575 courses.append(c) 576 576 #from pdb import set_trace;set_trace() 577 registered_courses = courses 577 registered_courses = courses 578 578 else: 579 579 if event_type == "sys_add_object": … … 675 675 data = {} 676 676 for field in self.schema(): 677 data[field] = getattr(course_doc,field,None) 677 data[field] = getattr(course_doc,field,None) 678 678 data[self.key] = course_brain.getId 679 679 ai = pl.index('academics') … … 712 712 return 713 713 for field in self.schema(): 714 data[field] = getattr(doc,field,None) 714 data[field] = getattr(doc,field,None) 715 715 data[self.key] = course_id 716 716 ai = rpl.index('academics') … … 725 725 #from pdb import set_trace;set_trace() 726 726 for field in self.schema(): 727 data[field] = getattr(object,field,None) 727 data[field] = getattr(object,field,None) 728 728 course_id = object.aq_parent.getId() 729 729 data[self.key] = course_id -
WAeUP_SRP/trunk/WAeUPTool.py
r1747 r1749 68 68 69 69 student_field2types = { ###( 70 'StudentApplication': 70 'StudentApplication': 71 71 {'id': 'application', 72 72 'title': 'Application Data', … … 74 74 ('jamb_reg_no', 75 75 'entry_mode', 76 'entry_level',76 #'entry_level', 77 77 'entry_session', 78 78 'jamb_score', … … 93 93 'fields': 94 94 ('matric_no', 95 'entry_level',95 #'entry_level', 96 96 'entry_session', 97 97 'nationality', … … 268 268 d = {'Title': f2t[pt]['title']} 269 269 for field in f2t[pt]['fields']: 270 d[field] = dict.get(field,'') 270 d[field] = dict.get(field,'') 271 271 if pt == 'StudentPersonal': 272 272 d['sex'] = dict.get('sex') == 'F' 273 273 sub_doc.edit(mapping = d) 274 274 self.portal_workflow.doActionFor(sub_obj,'close',dest_container=sub_obj) 275 275 276 276 entry_session = dict.get('entry_session') 277 277 wfaction = 'return' … … 705 705 res = self.students_catalog(jamb_reg_no = jamb_reg_no) 706 706 if res: 707 return '',"jamb_reg_no exists" 707 return '',"jamb_reg_no exists" 708 708 matric_no = dict.get('matric_no',None) 709 709 if matric_no: 710 710 res = self.students_catalog(matric_no = matric_no) 711 711 if res: 712 return '',"matric_no exists" 712 return '',"matric_no exists" 713 713 sid = self.waeup_tool.generateStudentId('?') 714 714 students_folder.invokeFactory('Student', sid) … … 724 724 d = {'Title': f2t[pt]['title']} 725 725 for field in f2t[pt]['fields']: 726 d[field] = dict.get(field,'') 726 d[field] = dict.get(field,'') 727 727 if pt == 'StudentPersonal': 728 728 d['sex'] = dict.get('sex') == 'F' … … 749 749 tr_count = 1 750 750 total = 0 751 iname = "import_%s" % name 751 iname = "import_%s" % name 752 752 stool = getToolByName(self, 'portal_schemas') 753 753 ltool = getToolByName(self, 'portal_layouts') … … 762 762 validators = {} 763 763 for widget in layout.keys(): 764 validators[widget] = layout[widget].validate 764 validators[widget] = layout[widget].validate 765 765 creator = getattr(self, 'create_%s' % name,None) 766 766 if creator is None: -
WAeUP_SRP/trunk/profiles/default/layouts/student_application.xml
r1700 r1749 71 71 <property name="hidden_readonly_layout_modes"/> 72 72 </widget> 73 <widget name="entry_session" meta_type="String Widget"> 74 <property name="title">Entry Session</property> 75 <property name="fields"> 76 <element value="entry_session"/> 77 </property> 78 <property name="label">Entry Session</property> 79 <property name="label_edit">Entry Session</property> 80 <property name="readonly_layout_modes"> 81 </property> 82 <property name="hidden_layout_modes"> 83 <element value="create"/> 84 </property> 85 <property name="hidden_readonly_layout_modes"/> 86 </widget> 73 87 <widget name="jamb_age" meta_type="Int Widget"> 74 88 <property name="title">JAMB Age</property> … … 300 314 </row> 301 315 <row> 316 <cell name="entry_session" ncols="3"/> 317 </row> 318 <row> 302 319 <cell name="jamb_first_cos" ncols="3"/> 303 320 </row> -
WAeUP_SRP/trunk/profiles/default/students_catalog.xml
r1707 r1749 40 40 <indexed_attr value="level"/> 41 41 </index> 42 <index name="entry_level" meta_type="FieldIndex">43 <indexed_attr value="entry_level"/>44 </index>45 42 <index name="mode" meta_type="FieldIndex"> 46 43 <indexed_attr value="mode"/> … … 67 64 <column value="email"/> 68 65 <column value="phone"/> 69 <column value="entry_level"/>70 66 <column value="level"/> 71 67 <column value="mode"/>
Note: See TracChangeset for help on using the changeset viewer.