Changeset 2575 for WAeUP_SRP


Ignore:
Timestamp:
7 Nov 2007, 22:56:44 (17 years ago)
Author:
Henrik Bettermann
Message:

further development of admit function (nearly finished)

Location:
WAeUP_SRP/base
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/WAeUPTool.py

    r2563 r2575  
    640640
    641641    security.declareProtected(ModifyPortalContent,'admitOneStudent') ###(
    642     def admitOneStudent(self,brain):
     642    def admitOneStudent(self,brain,entry_session):
    643643        "create Datastructure for an admitted Student"
    644644        #import pdb;pdb.set_trace()
     
    655655        students_folder.invokeFactory('Student', student_id)
    656656        student_object = getattr(students_folder,student_id)
    657         password = pin_parts[2]
    658         self.makeStudentMember(student_id,password = password)
     657        #password = pin_parts[2]
     658        #self.makeStudentMember(student_id,password = password)
     659        self.makeStudentMember(student_id)
    659660        student_object.manage_setLocalRoles(student_id, ['Owner',])
    660661        #logger.info("creating %s reg_no %s" % (student_id,brain.reg_no))
     
    664665        student_object.invokeFactory('StudentApplication','application')
    665666        application = student_object.application
    666         self.portal_workflow.doActionFor(application,'open',dest_container=application)
     667        #self.portal_workflow.doActionFor(application,'open',dest_container=application)
    667668        da = {'Title': 'Application Data'}
    668669        da['jamb_reg_no'] = brain.reg_no
    669         da['entry_mode'] = brain.entry_mode
    670         da['jamb_lastname'] = brain.lastname
     670       
    671671        sex = 'M'
    672672        if brain.sex:
    673673            sex = 'F'
    674674        da['jamb_sex'] = sex
    675         da['app_ac_pin'] = brain.pin
    676         state_lga = brain.lga.split('_')
    677         da['state_lga'] = state_lga[0]
    678         da['jamb_lga'] = state_lga[-1]
    679         #da['jamb_score'] = brain.????
     675        #da['app_ac_pin'] = brain.pin
     676        #if brain.lga:
     677        #    state_lga = brain.lga.split('_')
     678        #    da['state_lga'] = state_lga[0]
     679        #    da['jamb_lga'] = state_lga[-1]
     680        da['state_lga'] = brain.jamb_lga
     681        da['jamb_lga'] = brain.jamb_state
     682        da['jamb_score'] = brain.aggregate
    680683        da['app_email'] = brain.email
    681684        da['app_mobile'] = brain.phone
     685        if brain.entry_mode:
     686            da['entry_mode'] = brain.entry_mode
     687        elif brain.screening_type == 'pume':
     688            da['entry_mode'] = 'ume_ft'
     689        elif brain.screening_type == 'pde':
     690            da['entry_mode'] = 'de_ft'
     691        else:
     692            da['entry_mode'] = brain.screening_type
     693        da['entry_session'] = entry_session
     694        da['jamb_lastname'] = brain.lastname
     695        da['jamb_middlename'] = brain.middlenames   # different field names!
     696        da['firstname'] = brain.firstname
     697        da['screening_application_date'] = brain.application_date
     698        da['date_of_birth'] = brain.date_of_birth
     699        da['jamb_first_cos'] = brain.course1
     700        da['jamb_second_cos'] = brain.course2
     701        da['course3'] = brain.course3
     702        da['screening_type'] = brain.screening_type
     703        da['screening_score'] = brain.screening_score
     704        da['screening_date'] = brain.screening_date
     705        da['hq_type'] = brain.hq_type
     706        da['hq_grade'] = brain.hq_grade
     707        da['aos'] = brain.aos
     708       
    682709        application.getContent().edit(mapping=da)
    683         self.portal_workflow.doActionFor(application,'close',dest_container=application)
     710        #self.portal_workflow.doActionFor(application,'close',dest_container=application)
    684711        #
    685712        # personal
     
    687714        student_object.invokeFactory('StudentPersonal','personal')
    688715        personal = student_object.personal
    689         self.portal_workflow.doActionFor(personal,'open',dest_container=personal)
     716        #self.portal_workflow.doActionFor(personal,'open',dest_container=personal)
    690717        dp = {'Title': 'Personal Data'}
    691718        dp['sex'] = brain.sex
     
    693720        dp['phone'] = brain.phone
    694721        dp['lastname'] = brain.lastname
     722        dp['middlename'] = brain.middlenames   # different field names!
     723        dp['firstname'] = brain.firstname       
    695724        personal.getContent().edit(mapping=dp)
    696725        #
     
    699728        student_object.invokeFactory('StudentClearance','clearance')
    700729        clearance = student_object.clearance
    701         self.portal_workflow.doActionFor(clearance,'open',dest_container=clearance)
     730        #self.portal_workflow.doActionFor(clearance,'open',dest_container=clearance)
    702731        dc = {'Title': 'Clearance/Eligibility Record'}
    703732        dc['lga'] = brain.lga
    704733        clearance.getContent().edit(mapping=dc)
    705         self.portal_workflow.doActionFor(clearance,'close',dest_container=clearance)
     734        #self.portal_workflow.doActionFor(clearance,'close',dest_container=clearance)
    706735        #
    707736        # study Course
     
    709738        student_object.invokeFactory('StudentStudyCourse','study_course')
    710739        studycourse = student_object.study_course
    711         self.portal_workflow.doActionFor(studycourse,'open',dest_container=studycourse)
     740        #self.portal_workflow.doActionFor(studycourse,'open',dest_container=studycourse)
    712741        dsc = {}
    713742        dsc['study_course'] = brain.course_admitted
    714743        dsc['current_verdict'] = ''
    715         dsc['current_mode'] = brain.entry_mode
     744        dsc['current_mode'] = da['entry_mode']
     745        if da['entry_mode'].startswith('de'):
     746            dsc['current_level'] = '200'
     747        else:
     748            dsc['current_level'] = '100'
     749        dsc['current_session'] = entry_session
    716750        studycourse.getContent().edit(mapping=dsc)
    717751        #
  • WAeUP_SRP/base/skins/waeup_student/admitStudents.py

    r2540 r2575  
    2222    return
    2323
     24entry_session = '07'
    2425
    2526import logging
     
    3637    response.write("%s<br>\n\r" % s)
    3738
    38 brains = aq_applicants(In('status',('admitted'),)) 
     39brains = aq_applicants(In('status',('admitted'),))
    3940total = len(brains)
    4041logger.info("found %d students" % (total))
     
    5152        logger.info("Committing %s transactions, total %s" % (commit_after,count))
    5253        cocount += 1
    53         if cocount > 3:
     54        if cocount > 1:
    5455            break
    5556    brain = aq_applicants(Eq('reg_no',reg_no))[0]
    5657    #logger.info("start creating  objects of student %s" % (brain.reg_no))
    57     sid = d['student_id'] = context.waeup_tool.admitOneStudent(brain)
     58    sid = d['student_id'] = context.waeup_tool.admitOneStudent(brain,entry_session)
    5859    if sid is not None:
    5960        d['reg_no'] = reg_no
     
    6364    else:
    6465        logger.info("could not create  objects of student %s with pin " % (reg_no,brain.pin))
    65        
     66
    6667msg = "finished admitting %d students" % (admitted)
    6768logger.info(msg)
  • WAeUP_SRP/base/skins/waeup_student/application_edit_form.pt

    r1783 r2575  
    77                      layout_mode='edit',
    88                      schema_id = 'student_application',
    9                       layout_id = 'student_application_fe',
     9                      layout_id = 'student_application',
    1010                      request=request,
    1111                      use_session=True,);
  • WAeUP_SRP/base/skins/waeup_student/application_slip.pt

    r2288 r2575  
    1212              tal:content="structure python: info['app_doc'].render(proxy=info['app_doc'],
    1313              layout_mode='view_slip',
    14               layout_id='student_application_fe')"
     14              layout_id='student_application')"
    1515              />
    1616      </span>
Note: See TracChangeset for help on using the changeset viewer.