Improvements historization.

This commit is contained in:
Gaetan Delannay 2009-12-15 21:30:43 +01:00
parent d320a369c9
commit fff2b6a329
5 changed files with 49 additions and 85 deletions

View file

@ -163,7 +163,10 @@ class AbstractMixin:
modified values.'''
# Remove from previousData all values that were not changed
for fieldName in previousData.keys():
if getattr(self, fieldName) == previousData[fieldName][0]:
prev = previousData[fieldName][0]
curr = getattr(self, fieldName)
if (prev == curr) or ((prev == None) and (curr == '')) or \
((prev == '') and (curr == None)):
del previousData[fieldName]
if previousData:
# Create the event to add in the history