Changeset 8224
- Timestamp:
- 19 Apr 2012, 20:00:12 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.txt
r7933 r8224 189 189 190 190 >>> from waeup.kofa.utils.batching import BatchProcessor 191 >>> from waeup.kofa.interfaces import IGNORE_MARKER 191 192 >>> class CaveProcessor(BatchProcessor): 192 193 ... util_name = 'caveprocessor' … … 221 222 ... # updateEntry method does exactly the same 222 223 ... for key, value in row.items(): 223 ... setattr(obj, key, value) 224 ... if value != IGNORE_MARKER: 225 ... setattr(obj, key, value) 224 226 225 227 If we also want the results being logged, we must provide a logger … … 504 506 >>> result = processor.doImport('newcomers.csv', ['name', 505 507 ... 'dinoports', 'owner'], 506 ... mode='update', user='Bob' )508 ... mode='update', user='Bob', ignore_empty=False) 507 509 >>> result 508 510 (1, 0, '...', None)
Note: See TracChangeset for help on using the changeset viewer.