Changeset 12869 for main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Timestamp:
- 22 Apr 2015, 19:14:14 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/batching.py
r11891 r12869 35 35 36 36 class ApplicantsContainerProcessor(BatchProcessor): 37 """A processor for applicants containers. 37 """The Applicants Container Processor imports containers for applicants. 38 It does not import their content. There is nothing special about this 39 processor. 38 40 """ 39 41 grok.implements(IBatchProcessor) … … 76 78 77 79 class ApplicantProcessor(BatchProcessor): 78 """A batch processor for IApplicant objects. 79 80 In create mode container_code is required. If application_number is given 81 an applicant with this number is created in the designated container. 82 If application_number is not given a random application_number is assigned. 83 applicant_id is being determined by the system and can't be imported. 84 85 In update or remove mode container_code and application_number columns 86 must not exist. The applicant object is solely searched by its applicant_id 87 or reg_number. 80 """The Applicant Processor imports application records (applicants). 81 82 In create mode `container_code` is required. If `application_number` is 83 given, an applicant with this number is created in the designated container. 84 If `application_number` is not given, a random `application_number` is 85 assigned. `applicant_id` is being determined by the system and can't be 86 imported. 87 88 In update or remove mode `container_code` and `application_number` columns 89 must not exist. The applicant object is solely localized by 90 `applicant_id` or `reg_number`. 88 91 """ 89 92 grok.implements(IBatchProcessor) … … 95 98 iface = IApplicant 96 99 iface_byregnumber = IApplicantUpdateByRegNo 97 location_fields = ['']98 100 factory_name = 'waeup.Applicant' 99 101 … … 303 305 if cert is not None and (mode in ('create', 'update')): 304 306 # course1 application category must match container's. 305 parent = self.getParent(row, self.site) 307 site = grok.getSite() 308 parent = self.getParent(row, site) 306 309 if parent is None: 307 310 errs.append(('container', 'not found')) … … 332 335 return 'Applicant is blocked.' 333 336 return None 334 335 def doImport(self, *args, **kw):336 # XXX: Not thread-safe. Parallel applicant imports into337 # different sites could mean a mess. Luckily this is not a338 # typical use-case. On the other hand it spares thousands of339 # site lookups during large imports.340 # XXX: Maybe this should go into Importer base.341 self.site = grok.getSite() # needed by checkConversion()342 return super(ApplicantProcessor, self).doImport(*args, **kw)
Note: See TracChangeset for help on using the changeset viewer.