Ignore:
Timestamp:
29 Aug 2006, 11:56:53 (18 years ago)
Author:
joachim
Message:

levels can be created
keyerror elective fixed
check for blanks in Id's checked

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Students.py

    r435 r440  
    3333    portal_type = meta_type
    3434    security = ClassSecurityInfo()
    35     use_catalog_for_folder_contents = True
    3635
    3736    security.declareProtected(ModifyPortalContent,"loadFullTimeStudentsFromCSV")###(
     
    470469###)
    471470
    472 class StudentDocuments(CPSDocument): ###(
    473     """
    474     WAeUP Student container for the various student data
    475     """
    476     meta_type = 'StudentDocuments'
    477     portal_type = meta_type
    478     security = ClassSecurityInfo()
    479 
    480     security.declareProtected(View,"Title")
    481     def Title(self):
    482         """compose title"""
    483         content = self.getContent()
    484         return "Scanned Documents"
    485 
    486 
    487 InitializeClass(StudentDocuments)
    488 
    489 def addStudentDocuments(container, id, REQUEST=None, **kw):
    490     """Add a Students documents"""
    491     ob = StudentDocuments(id, **kw)
    492     return CPSBase_adder(container, ob, REQUEST=REQUEST)
    493 
    494 ###)
    495 
    496 class Jamb(CPSDocument): ###(
    497     """
    498     WAeUP Jamb containing the courses and students
    499     """
    500     meta_type = 'Jamb'
    501     portal_type = meta_type
    502     security = ClassSecurityInfo()
    503 
    504     security.declareProtected(View,"Title")
    505     def Title(self):
    506         """compose title"""
    507         content = self.getContent()
    508         return "JAMB Data for %s %s" % (content.firstname,content.lastname)
    509 
    510     security.declareProtected(View,"setOwnership")
    511     def setOwnership(self,member_id):
    512         """set ownership"""
    513         pm = getattr(self,'portal_membership')
    514         member = pm.getMemberById(member_id)
    515         self.changeOwnership(member)
    516 
    517 InitializeClass(Jamb)
    518 
    519 def addJamb(container, id, REQUEST=None, **kw):
    520     """Add a Jamb."""
    521     ob = Jamb(id, **kw)
    522     return CPSBase_adder(container, ob, REQUEST=REQUEST)
    523 
    524 ###)
    525 
    526471class StudyLevel(CPSDocument): ###(
    527472    """
     
    531476    portal_type = meta_type
    532477    security = ClassSecurityInfo()
     478
     479    security.declareProtected(View,"Title")
     480    def Title(self):
     481        """compose title"""
     482        return "Level %s" % self.aq_parent.getId()
     483   
    533484
    534485InitializeClass(StudyLevel)
     
    558509###)
    559510
     511class ScratchCardBatchesFolder(CPSDocument): ###(
     512    """
     513    WAeUP Student container for the various student data
     514    """
     515    meta_type = 'ScratchCardBatchesFolder'
     516    portal_type = meta_type
     517    security = ClassSecurityInfo()
     518
     519    security.declareProtected(View,"Title")
     520    def Title(self):
     521        """compose title"""
     522        return "Pin Batches"
     523
     524
     525InitializeClass(ScratchCardBatchesFolder)
     526
     527def addScratchCardBatchesFolder(container, id, REQUEST=None, **kw):
     528    """Add a Students personal data."""
     529    ob = ScratchCardBatchesFolder(id, **kw)
     530    return CPSBase_adder(container, ob, REQUEST=REQUEST)
     531
     532###)
     533
     534from Products.WAeUP_SRP.WAeUPTables import PinTable
     535
     536class ScratchCardBatch(CPSDocument): ###(
     537    """
     538    WAeUP Student container for the various student data
     539    """
     540    meta_type = 'ScratchCardBatch'
     541    portal_type = meta_type
     542    security = ClassSecurityInfo()
     543
     544    security.declareProtected(View,"Title")
     545    def Title(self):
     546        """compose title"""
     547        doc = self.getContent()
     548        return "Pin Batch %s BatchNo %d" % (doc.prefix, doc.batch_no)
     549
     550
     551InitializeClass(ScratchCardBatch)
     552
     553def addScratchCardBatch(container, id, REQUEST=None, **kw):
     554    """Add a Students personal data."""
     555    ob = ScratchCardBatch(id, **kw)
     556    return CPSBase_adder(container, ob, REQUEST=REQUEST)
     557
     558###)
Note: See TracChangeset for help on using the changeset viewer.