Improve pre/post write decorators
- Added priority
- Handle if methods are overridden in subclasses, by mergin all defined dependencies.
Last feature is for case, when you hanve Models A
with method meth_1
that has to be called when field field_1
is changed.
Next you want to add one more module, that adds new field field_2
, and
want to call same method meth_1
when field_2
changed.
Next you want to add one more module (that does not know about module
2), that adds new field field_3
and want to call same emthod
meth_1
when field_3
changed.
So, no you can override same method in subclasses and specify only new
fields in pre_write
or post_write
decorators, and system will
automatically call same methon when any of (field_1
, field_2
,
field_3
) changed.