- Timestamp:
- 21 Apr 2021, 14:35:48 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/batching.py
r16467 r16472 21 21 import grok 22 22 from time import time 23 import unicodecsv 23 24 from zope.schema import getFields 24 25 from zope.interface import Interface … … 363 364 factory_name = 'waeup.ApplicantOnlinePayment' 364 365 365 location_fields = ['applicant_id', 'p_id']366 location_fields = ['applicant_id',] 366 367 367 368 @property … … 379 380 "Need p_id for import in update and remove modes!") 380 381 return True 382 383 def getMapping(self, path, headerfields, mode): 384 """Get a mapping from CSV file headerfields to actually used fieldnames. 385 386 """ 387 result = dict() 388 reader = unicodecsv.reader(open(path, 'rb')) 389 raw_header = reader.next() 390 for num, field in enumerate(headerfields): 391 if field not in ['applicant_id', 'p_id'] and mode == 'remove': 392 continue 393 if field == u'--IGNORE--': 394 continue 395 result[raw_header[num]] = field 396 return result 381 397 382 398 def parentsExist(self, row, site):
Note: See TracChangeset for help on using the changeset viewer.