- Timestamp:
- 30 May 2011, 21:57:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/batching.py
r6250 r6251 26 26 from waeup.sirp.interfaces import IBatchProcessor 27 27 from waeup.sirp.utils.batching import BatchProcessor 28 from waeup.sirp.applicants. jambtables.interfaces import IApplicantPDEImportData28 from waeup.sirp.applicants.interfaces import IApplicantsContainer 29 29 30 class JAMBDataImporter(BatchProcessor):31 """An importer for applicants .30 class ApplicantsContainerImporter(BatchProcessor): 31 """An importer for applicants containers. 32 32 """ 33 33 grok.implements(IBatchProcessor) 34 34 grok.provides(IBatchProcessor) 35 35 grok.context(Interface) 36 util_name = 'applica tionimporter'36 util_name = 'applicants container importer' 37 37 grok.name(util_name) 38 38 39 name = u' JAMB DataImporter'39 name = u'Applicants Container Importer' 40 40 mode = u'create' 41 iface = IApplicant PDEImportData41 iface = IApplicantsContainer 42 42 43 location_fields = [' reg_no',]44 factory_name = 'waeup.Applicant '43 location_fields = ['code',] 44 factory_name = 'waeup.ApplicantContainer' 45 45 46 46 def parentsExist(self, row, site): 47 return ' jambdata' in site.keys()47 return 'applicants' in site.keys() 48 48 49 49 def entryExists(self, row, site): 50 return row[' reg_no'] in site['jambdata'].keys()50 return row['code'] in site['applicants'].keys() 51 51 52 52 def getParent(self, row, site): 53 return site[' jambdata']53 return site['applicants'] 54 54 55 55 def getEntry(self, row, site): … … 57 57 return None 58 58 parent = self.getParent(row, site) 59 return parent.get(row[' reg_no'])59 return parent.get(row['code']) 60 60 61 61 def addEntry(self, obj, row, site): 62 62 parent = self.getParent(row, site) 63 reg_no = row['reg_no'] 64 parent[reg_no] = obj 63 parent[row['code']] = obj 65 64 return 66 65 67 66 def delEntry(self, row, site): 68 67 parent = self.getParent(row, site) 69 del parent[row[' reg_no']]68 del parent[row['code']] 70 69 return
Note: See TracChangeset for help on using the changeset viewer.