Changeset 2514
- Timestamp:
- 3 Nov 2007, 15:27:54 (17 years ago)
- Location:
- WAeUP_SRP
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/WAeUPTool.py
r2501 r2514 633 633 ###) 634 634 635 security.declarePublic('admitOneStudent') ###( 636 def admitOneStudent(self,brain): 637 "create Datastructure for an admitted Student" 638 #import pdb;pdb.set_trace() 639 students_folder = self.portal_url.getPortalObject().campus.students 640 logger = logging.getLogger('WAeUPTool.admitStudent') 641 if brain.status != "admitted": 642 logger.info('status of %s is %s' % (brain.reg_no,brain.status)) 643 pin_parts = brain.pin.split('-') 644 if len(pin_parts) != 3: 645 logger.info('invalid pin %s for %s' % (brain.pin,brain.reg_no)) 646 student_id = self.generateStudentId(letter) 647 students_folder.invokeFactory('Student', student_id) 648 student_object = getattr(students_folder,student_id) 649 password = pin_parts[2] 650 self.makeStudentMember(student_id,password = password) 651 student.manage_setLocalRoles(sid, ['Owner',]) 652 logger.info("creating %s reg_no %s" % (student_id,brain.reg_no)) 653 # 654 # application 655 # 656 student_obj.invokeFactory('StudentApplication','application') 657 application = student_obj.application 658 self.portal_workflow.doActionFor(application,'open',dest_container=application) 659 da = {'Title': 'Application Data'} 660 da['jamb_reg_no'] = brain.reg_no 661 da['entry_mode'] = brain.entry_mode 662 da['jamb_lastname'] = brain.lastname 663 da['jamb_sex'] = brain.sex 664 da['jamb_lga'] = brain.lga 665 da['app_email'] = brain.email 666 da['app_mobile'] = brain.phone_nr 667 application.getContent().edit(mapping=da) 668 self.portal_workflow.doActionFor(application,'close',dest_container=application) 669 # 670 # personal 671 # 672 student_obj.invokeFactory('StudentPersonal','personal') 673 personal = student_obj.personal 674 self.portal_workflow.doActionFor(personal,'open',dest_container=personal) 675 dp = {'Title': 'Personal Data'} 676 dp['sex'] = brain.sex 677 dp['email'] = brain.email 678 dp['phone'] = brain.phone_nr 679 dp['lastname'] = brain.lastname 680 personal.getContent().edit(mapping=dp) 681 # 682 # clearance 683 # 684 student_obj.invokeFactory('StudentClearance','clearance') 685 clearance = student_obj.clearance 686 self.portal_workflow.doActionFor(clearance,'open',dest_container=clearance) 687 dc = {'Title': 'Clearance/Eligibility Record'} 688 dc['lga'] = brain.lga 689 clearance.getContent().edit(mapping=dc) 690 self.portal_workflow.doActionFor(clearance,'close',dest_container=clearance) 691 # 692 # study Course 693 # 694 student_obj.invokeFactory('StudentStudyCourse','study_course') 695 studycourse = student_obj.study_course 696 self.portal_workflow.doActionFor(studycourse,'open',dest_container=studycourse) 697 dsc = {} 698 dsc['study_course'] = brain.course_admitted 699 dsc['current_verdict'] = '' 700 dsc['current_mode'] = brain.entry_mode 701 studycourse.getContent().edit(mapping=dsc) 702 # 703 # payments folder 704 student_obj.invokeFactory('PaymentsFolder','payments') 705 payments = getattr(student_obj,'payments') 706 dpay = {} 707 dpay['Title'] = 'Payments' 708 payments.getContent().edit(mapping=dpay) 709 wftool.doActionFor(payments,'open') 710 return student_id 711 ###) 712 635 713 security.declarePublic('makeStudentLevel') ###( 636 714 def makeStudentLevel(self,student_id): … … 1132 1210 c.getContent().edit(mapping=mapping) 1133 1211 return certificate_id,'' 1212 ###) 1213 1214 security.declareProtected(ModifyPortalContent,'mass_create_applicant') ###( 1215 def mass_create_applicant(self,mapping): 1216 #import pdb;pdb.set_trace() 1217 try: 1218 self.applicants_catalog.addRecord(**mapping) 1219 except ValueError: 1220 return '', "applicant already exists: %s" % mapping.get('reg_no') 1221 return key,'' 1222 ###) 1223 1224 security.declareProtected(ModifyPortalContent,'mass_edit_applicant') ###( 1225 def mass_edit_applicant(self,mapping): 1226 #import pdb;pdb.set_trace() 1227 reg_no = mapping.get('reg_no') 1228 try: 1229 self.applicants_catalog.modifyRecord(**mapping) 1230 except KeyError: 1231 return '', "applicant does not exists: %s" % reg_no 1232 return reg_no,'' 1134 1233 ###) 1135 1234 … … 1527 1626 for id,widget in layout.objectItems() 1528 1627 if widget.is_required] 1529 #import pdb;pdb.set_trace()1530 1628 if not set(required_keys).issubset(set(import_keys)): 1531 1629 diff2import = set(required_keys).difference(set(import_keys)) -
WAeUP_SRP/base/skins/waeup_utilities/moveCourseResults.py
r2513 r2514 47 47 cocount = 0 48 48 commit_after = 20 49 moved_sids = context.course_results.uniqueValuesFor('student_id') 49 50 for brain in brains: 50 51 count += 1 51 already_moved = aq_results(Eq('student_id',brain.id)) 52 if len(already_moved) > 0: 52 if brain.id in moved_sids: 53 53 continue 54 54 try: … … 71 71 context.waeup_tool.doCommit() 72 72 logger.info("Committing %s transactions, total %s" % (commit_after,count)) 73 #cocount += 174 #if cocount > 3:75 #break73 cocount += 1 74 if cocount > 2: 75 break 76 76 77 77 msg = "finished moving results of %d students" % (moved) -
WAeUP_SRP/uniben/profiles/default/layouts.xml
r2510 r2514 16 16 <object name="import_certificate_course" meta_type="CPS Layout"/> 17 17 <object name="course" meta_type="CPS Layout"/> 18 <object name="import_applicant" meta_type="CPS Layout"/> 18 19 <object name="import_course" meta_type="CPS Layout"/> 19 20 <object name="import_course_result" meta_type="CPS Layout"/> -
WAeUP_SRP/uniben/profiles/default/schemas.xml
r2504 r2514 12 12 <object name="certificate_course" meta_type="CPS Schema"/> 13 13 <object name="import_certificate_course" meta_type="CPS Schema"/> 14 <object name="import_applicant" meta_type="CPS Schema"/> 14 15 <object name="import_course" meta_type="CPS Schema"/> 15 16 <object name="import_course_result" meta_type="CPS Schema"/> -
WAeUP_SRP/uniben/profiles/default/vocabularies/import_names.xml
r2510 r2514 13 13 <item key="certificate" msgid="">Certificate Data</item> 14 14 <item key="certificate_course" msgid="">Certificate Course Data</item> 15 <item key="applica tion" msgid="">Application Data</item>15 <item key="applicant" msgid="">Application Data</item> 16 16 </object>
Note: See TracChangeset for help on using the changeset viewer.