bartek
2008-07-04 09:54:30 UTC
Hello,
A couple of would-be users of ERP5 asked me about possibility to
store/retrieve past values of an object property, to be able to find out
who changed it and when, and if necessary to rollback or use a past
value "as of a given date". There is a number of common use cases for
that, which I'll describe elsewhere.
Currently, the only way to retrieve a past value is the Zope's in-build
mechanism, which is difficult to use and can serve only emergency
purposes, and all the history is irrecoverably lost when database is
packed. But I think it can be easily implemented using accessor
generation and property sheets. What I mean is this: an application
developer defines in a property sheet which properties should be
"tracked", like this:
_trackable = ('title', 'vat_code')
This would modify behaviour of respective setters so that when a value
changes, the change is stored in contained object similar to
workflow_history (sthg like "property_history"). Then getters could
accept an argument "at_date" - et ceatera.
What do you think?
Bartek
A couple of would-be users of ERP5 asked me about possibility to
store/retrieve past values of an object property, to be able to find out
who changed it and when, and if necessary to rollback or use a past
value "as of a given date". There is a number of common use cases for
that, which I'll describe elsewhere.
Currently, the only way to retrieve a past value is the Zope's in-build
mechanism, which is difficult to use and can serve only emergency
purposes, and all the history is irrecoverably lost when database is
packed. But I think it can be easily implemented using accessor
generation and property sheets. What I mean is this: an application
developer defines in a property sheet which properties should be
"tracked", like this:
_trackable = ('title', 'vat_code')
This would modify behaviour of respective setters so that when a value
changes, the change is stored in contained object similar to
workflow_history (sthg like "property_history"). Then getters could
accept an argument "at_date" - et ceatera.
What do you think?
Bartek
--
"feelings affect productivity. (...) unhappy people write worse
software, and less of it."
Karl Fogel, "Producing Open Source Software"
"feelings affect productivity. (...) unhappy people write worse
software, and less of it."
Karl Fogel, "Producing Open Source Software"