Changeset 6628 for main/waeup.sirp/trunk


Ignore:
Timestamp:
25 Aug 2011, 16:21:25 (13 years ago)
Author:
uli
Message:

Add missing pieces for implementing interfaces correctly.
Fix one bug detected by tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/university/batching.py

    r6243 r6628  
    1818    """A batch processor for IFaculty objects.
    1919    """
     20    grok.implements(IBatchProcessor)
    2021    grok.provides(IBatchProcessor)
    2122    grok.context(Interface)
     
    2930    factory_name = 'waeup.Faculty'
    3031
     32    mode = None
     33
    3134    def parentsExist(self, row, site):
    3235        return 'faculties' in site.keys()
     
    4346        parent = self.getParent(row, site)
    4447        return parent.get(row['code'])
    45    
     48
    4649    def addEntry(self, obj, row, site):
    4750        parent = self.getParent(row, site)
     
    5760    """A batch processor for IDepartment objects.
    5861    """
     62    grok.implements(IBatchProcessor)
    5963    grok.provides(IBatchProcessor)
    6064    grok.context(Interface)
     
    6872    factory_name = 'waeup.Department'
    6973
     74    mode = None
     75
    7076    def parentsExist(self, row, site):
    7177        if not 'faculties' in site.keys():
     
    8793        parent = self.getParent(row, site)
    8894        return parent.get(row['code'])
    89    
     95
    9096    def addEntry(self, obj, row, site):
    9197        parent = self.getParent(row, site)
     
    101107    """A batch processor for ICourse objects.
    102108    """
     109    grok.implements(IBatchProcessor)
    103110    grok.provides(IBatchProcessor)
    104111    grok.context(Interface)
     
    112119    factory_name = 'waeup.Course'
    113120
     121    mode = None
     122
    114123    def parentsExist(self, row, site):
    115124        if not 'faculties' in site.keys():
     
    135144        parent = self.getParent(row, site)
    136145        return parent.get(row['code'])
    137    
     146
    138147    def addEntry(self, obj, row, site):
    139148        parent = self.getParent(row, site)
     
    149158    """A batch processor for ICertificate objects.
    150159    """
     160    grok.implements(IBatchProcessor)
    151161    grok.provides(IBatchProcessor)
    152162    grok.context(Interface)
     
    160170    factory_name = 'waeup.Certificate'
    161171
     172    mode = None
     173
    162174    def parentsExist(self, row, site):
    163175        if not 'faculties' in site.keys():
     
    197209    """A batch processor for ICertificateCourse objects.
    198210    """
     211    grok.implements(IBatchProcessor)
    199212    grok.provides(IBatchProcessor)
    200213    grok.context(Interface)
     
    209222    factory_name = 'waeup.CertificateCourse'
    210223
     224    mode = None
     225
    211226    def parentsExist(self, row, site):
    212227        if not 'faculties' in site.keys():
     
    235250            return None
    236251        parent = self.getParent(row, site)
    237         return parent.get(row['course'])
     252        return parent.get("%s_%s" % (row['course'].code, row['level']))
    238253
    239254    def addEntry(self, obj, row, site):
Note: See TracChangeset for help on using the changeset viewer.