Changeset 758 for WAeUP_SRP


Ignore:
Timestamp:
27 Oct 2006, 07:24:22 (18 years ago)
Author:
Henrik Bettermann
Message:

StudentPume? class added

Location:
WAeUP_SRP/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Students.py

    r757 r758  
    556556        while hasattr(students, sid):
    557557            sid = "%c%d" % (letter,r.randint(99999,1000000))
    558         return sid 
     558        return sid
    559559        #return "%c%d" % (r.choice('ABCDEFGHKLMNPQRSTUVWXY'),r.randint(99999,1000000))
    560560    ###)
     
    607607###)
    608608
    609     security.declareProtected(View,'createSubObjects') ###(
    610     def createSubObjects(self):
    611         """make the student a member"""
    612         dp = {'Title': 'Personal Data'}
    613         app_doc = self.application.getContent()
    614         names = app_doc.jamb_lastname.split()
    615         if len(names) == 3:
    616             dp['firstname'] = names[0].capitalize()
    617             dp['middlename'] = names[1].capitalize()
    618             dp['lastname'] = names[2].capitalize()
    619         elif len(names) == 2:
    620             dp['firstname'] = names[0].capitalize()
    621             dp['lastname'] = names[1].capitalize()
    622         else:
    623             dp['lastname'] = app_doc.jamb_lastname
    624         dp['sex'] = app_doc.jamb_sex == 'F'
    625         dp['lga'] = "%s/%s" % (app_doc.jamb_state,app_doc.jamb_lga )
    626         proxy = self.aq_parent
    627         proxy.invokeFactory('StudentPersonal','personal')
    628         per = proxy.personal
    629         per_doc = per.getContent()
    630         per_doc.edit(mapping = dp)
    631         per.manage_setLocalRoles(self.getId(), ['Owner',])
    632         #self.portal_workflow.doActionFor(per,'open',dest_container=per)
     609##    security.declareProtected(View,'createSubObjects') ###(
     610##   def createSubObjects(self):
     611##        """make the student a member"""
     612##        dp = {'Title': 'Personal Data'}
     613##        app_doc = self.application.getContent()
     614##        names = app_doc.jamb_lastname.split()
     615##        if len(names) == 3:
     616##            dp['firstname'] = names[0].capitalize()
     617##            dp['middlename'] = names[1].capitalize()
     618##            dp['lastname'] = names[2].capitalize()
     619##        elif len(names) == 2:
     620##            dp['firstname'] = names[0].capitalize()
     621##            dp['lastname'] = names[1].capitalize()
     622##        else:
     623##            dp['lastname'] = app_doc.jamb_lastname
     624##        dp['sex'] = app_doc.jamb_sex == 'F'
     625##        dp['lga'] = "%s/%s" % (app_doc.jamb_state,app_doc.jamb_lga )
     626##        proxy = self.aq_parent
     627##        proxy.invokeFactory('StudentPersonal','personal')
     628##        per = proxy.personal
     629##        per_doc = per.getContent()
     630##        per_doc.edit(mapping = dp)
     631##        per.manage_setLocalRoles(self.getId(), ['Owner',])
     632##        #self.portal_workflow.doActionFor(per,'open',dest_container=per)
    633633
    634634###)
     
    805805    return CPSBase_adder(container, ob, REQUEST=REQUEST)
    806806
     807
     808class StudentPume(CPSDocument): ###(
     809    """
     810    WAeUP Student container for the various student data
     811    """
     812    meta_type = 'StudentPume'
     813    portal_type = meta_type
     814    security = ClassSecurityInfo()
     815
     816    security.declareProtected(View,"Title")
     817    def Title(self):
     818        """compose title"""
     819        return "PUME Results"
     820
     821
     822InitializeClass(StudentPume)
     823
     824def addStudentPume(container, id, REQUEST=None, **kw):
     825    """Add a Students PUME data."""
     826    ob = StudentPume(id, **kw)
     827    return CPSBase_adder(container, ob, REQUEST=REQUEST)
     828
    807829###)
    808830
     
    824846#####)
    825847
    826 class Semester(CPSDocument): ###(
    827     """
    828     WAeUP Semester containing the courses and students
    829     """
    830     meta_type = 'Semester'
    831     portal_type = meta_type
    832     security = ClassSecurityInfo()
    833 
    834 InitializeClass(Semester)
    835 
    836 def addSemester(container, id, REQUEST=None, **kw):
    837     """Add a Semester."""
    838     ob = Semester(id, **kw)
    839     return CPSBase_adder(container, ob, REQUEST=REQUEST)
    840 
    841 ###)
     848##class Semester(CPSDocument): ###(
     849##    """
     850##    WAeUP Semester containing the courses and students
     851##    """
     852##    meta_type = 'Semester'
     853##    portal_type = meta_type
     854##    security = ClassSecurityInfo()
     855##
     856##InitializeClass(Semester)
     857##
     858##def addSemester(container, id, REQUEST=None, **kw):
     859##    """Add a Semester."""
     860##    ob = Semester(id, **kw)
     861##    return CPSBase_adder(container, ob, REQUEST=REQUEST)
     862##
     863#####)
    842864
    843865class StudentCourseResult(CPSDocument): ###(
  • WAeUP_SRP/trunk/Widgets.py

    r747 r758  
    363363        datastructure[widget_id+'_b'] = b
    364364        datastructure[widget_id+'_n'] = n
    365        
     365
    366366###)
    367367
     
    386386        while 1:
    387387            if ok == -2:
    388                 err = 'You have already applied with a different Pin, please login'
     388                err = 'You have already applied with a different Pin, please login.'
    389389                break
    390390            elif ok == -1:
     
    453453        datastructure[widget_id+'_b'] = b
    454454        datastructure[widget_id+'_n'] = n
    455         return meth(mode=mode, 
    456                     datastructure=datastructure, 
     455        return meth(mode=mode,
     456                    datastructure=datastructure,
    457457                    )
    458458    ###)
  • WAeUP_SRP/trunk/__init__.py

    r639 r758  
    4646         "StudentCourseResult",
    4747         "StudentApplication",
     48         "StudentPume",
    4849         "StudentClearance",
    4950         "StudentPersonal",
  • WAeUP_SRP/trunk/profiles/default/types/Student.xml

    r659 r758  
    1313 <property name="allowed_content_types">
    1414  <element value="StudentAccommodation"/>
    15   <element value="StudentDocuments"/>
     15  <element value="StudentApplication"/>
     16  <element value="StudentPume"/> 
    1617  <element value="StudentPersonal"/>
    1718  <element value="StudentStudyCourse"/>
Note: See TracChangeset for help on using the changeset viewer.