You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using a custom base model quite often that automatically sets a certain field in it's overridden save method. Using FieldTracker().changed() will then obviously return this field as changed.
To make my life easier excluding such an automatic change, I'd like to introduce exclude lists to FieldInstanceTracker.changed.
Signature would change from
defchanged(self):
to
defchanged(self, exclude: list=None) ->dict:
so that it will be fully backwards compatible. exclude should be a list of field names that will be omitted when generating the result dict.
If you think that this will be a suitable addition to the library, then I'd be happy to provide a pull request.
Just one open question: Would you like the tests to be synthetic one just for FieldInstanceTracker.changed or extend FieldTrackerTests etc. accordingly with a assertChangedExcludes test every time an assertChanged test happens right now?
The text was updated successfully, but these errors were encountered:
Problem
I'm using a custom base model quite often that automatically sets a certain field in it's overridden save method. Using
FieldTracker().changed()
will then obviously return this field as changed.To make my life easier excluding such an automatic change, I'd like to introduce exclude lists to
FieldInstanceTracker.changed
.Signature would change from
to
so that it will be fully backwards compatible.
exclude
should be a list of field names that will be omitted when generating the result dict.If you think that this will be a suitable addition to the library, then I'd be happy to provide a pull request.
Just one open question: Would you like the tests to be synthetic one just for
FieldInstanceTracker.changed
or extendFieldTrackerTests
etc. accordingly with aassertChangedExcludes
test every time anassertChanged
test happens right now?The text was updated successfully, but these errors were encountered: