Ignore:
Timestamp:
30 May 2011, 21:57:00 (13 years ago)
Author:
uli
Message:

First steps to make the copied batch-stuff work with regular applicants. Right now we only get more errors.

File:
1 edited

Legend:

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

    r6250 r6251  
    2626from waeup.sirp.interfaces import IBatchProcessor
    2727from waeup.sirp.utils.batching import BatchProcessor
    28 from waeup.sirp.applicants.jambtables.interfaces import IApplicantPDEImportData
     28from waeup.sirp.applicants.interfaces import IApplicantsContainer
    2929
    30 class JAMBDataImporter(BatchProcessor):
    31     """An importer for applicants.
     30class ApplicantsContainerImporter(BatchProcessor):
     31    """An importer for applicants containers.
    3232    """
    3333    grok.implements(IBatchProcessor)
    3434    grok.provides(IBatchProcessor)
    3535    grok.context(Interface)
    36     util_name = 'application importer'
     36    util_name = 'applicants container importer'
    3737    grok.name(util_name)
    3838
    39     name = u'JAMB Data Importer'
     39    name = u'Applicants Container Importer'
    4040    mode = u'create'
    41     iface = IApplicantPDEImportData
     41    iface = IApplicantsContainer
    4242
    43     location_fields = ['reg_no',]
    44     factory_name = 'waeup.Applicant'
     43    location_fields = ['code',]
     44    factory_name = 'waeup.ApplicantContainer'
    4545
    4646    def parentsExist(self, row, site):
    47         return 'jambdata' in site.keys()
     47        return 'applicants' in site.keys()
    4848
    4949    def entryExists(self, row, site):
    50         return row['reg_no'] in site['jambdata'].keys()
     50        return row['code'] in site['applicants'].keys()
    5151
    5252    def getParent(self, row, site):
    53         return site['jambdata']
     53        return site['applicants']
    5454
    5555    def getEntry(self, row, site):
     
    5757            return None
    5858        parent = self.getParent(row, site)
    59         return parent.get(row['reg_no'])
     59        return parent.get(row['code'])
    6060
    6161    def addEntry(self, obj, row, site):
    6262        parent = self.getParent(row, site)
    63         reg_no = row['reg_no']
    64         parent[reg_no] = obj
     63        parent[row['code']] = obj
    6564        return
    6665
    6766    def delEntry(self, row, site):
    6867        parent = self.getParent(row, site)
    69         del parent[row['reg_no']]
     68        del parent[row['code']]
    7069        return
Note: See TracChangeset for help on using the changeset viewer.