Changeset 8202 for main/waeup.kofa/trunk/src/waeup/kofa/utils
- Timestamp:
- 18 Apr 2012, 05:12:32 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/utils
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py
r7950 r8202 32 32 from waeup.kofa.interfaces import ( 33 33 IBatchProcessor, FatalCSVError, IObjectConverter, 34 ICSVExporter )34 ICSVExporter, DELETIONMARKER) 35 35 36 36 class BatchProcessor(grok.GlobalUtility): … … 204 204 # Skip fields not declared in interface. 205 205 if hasattr(obj, key): 206 setattr(obj, key, value) 206 # Set attribute to None if value is marked for deletion 207 if value == DELETIONMARKER: 208 setattr(obj, key, None) 209 elif value is not None: 210 setattr(obj, key, value) 207 211 return 208 212 -
main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_batching.py
r7858 r8202 104 104 105 105 def updateEntry(self, obj, row, site): 106 # This is not strictly necessary, as the default107 # updateEntry method does exactly the same108 106 for key, value in row.items(): 109 setattr(obj, key, value) 107 if value is not None: 108 setattr(obj, key, value) 110 109 111 110 class BatchProcessorTests(FunctionalTestCase):
Note: See TracChangeset for help on using the changeset viewer.