Changeset 17763 for main/waeup.kofa/trunk/src
- Timestamp:
- 11 May 2024, 19:55:45 (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/documents/batching.py
r13145 r17763 24 24 import unicodecsv as csv # XXX: csv ops should move to dedicated module. 25 25 from time import time 26 from ast import literal_eval 26 27 from datetime import datetime 27 28 from zope.i18n import translate … … 32 33 from zope.catalog.interfaces import ICatalog 33 34 from hurry.workflow.interfaces import IWorkflowState, IWorkflowInfo 34 from waeup.kofa.interfaces import ( 35 from waeup.kofa.interfaces import (IObjectHistory, 35 36 IBatchProcessor, FatalCSVError, IObjectConverter, IUserAccount, 36 37 IGNORE_MARKER) … … 63 64 64 65 location_fields = ['document_id',] 65 additional_fields = ['class_name', ]66 additional_fields = ['class_name', 'state', 'history'] 66 67 67 68 factory_name = None … … 114 115 items_changed = super(DocumentProcessorBase, self).updateEntry( 115 116 obj, row, site, filename) 117 # Replace entire history 118 if 'history' in row: 119 new_history = row.get('history', IGNORE_MARKER) 120 if new_history not in (IGNORE_MARKER, ''): 121 history = IObjectHistory(obj) 122 history._annotations[ 123 history.history_key] = literal_eval(new_history) 124 items_changed += ('%s=%s, ' % ('history', new_history)) 125 row.pop('history') 126 # Update state 127 if 'state' in row: 128 state = row.get('state', IGNORE_MARKER) 129 if state not in (IGNORE_MARKER, ''): 130 IWorkflowState(obj).setState(state) 131 msg = _("State '${a}' set", mapping = {'a':state}) 132 history = IObjectHistory(obj) 133 history.addMessage(msg) 134 items_changed += ('%s=%s, ' % ('state', state)) 135 row.pop('state') 116 136 # Log actions... 117 137 location_field = self.location_fields[0]
Note: See TracChangeset for help on using the changeset viewer.