romgar/django-dirtyfields

Why only local fields?

Closed this issue · 6 comments

Why are only local fields checked for changes and not all fields?

aaj commented

I've also found myself in a situation where checking only local fields is not enough. Is there an easy way to modify this so it takes into account ALL fields, including foreign key and m2m relationships?

yes yes yes! I found this and thought "oh how cool!", until I realized it doesnt work for foreignkey :(

smn commented

There are multiple people asking for this. I'm more than happy to review any contributed code.

I'll take a stab at it soon if no one else does... found this too which may or may not apply http://www.netlandish.com/blog/2013/12/14/easily-track-data-changes-in-your-django-models/

This issue can be closed, because of PR #16 ?

Foreign keys are now managed with check_relationship parameter.

For m2m relations, we are adding new instances to an object with .add() method, that is saving them in db. Dirtyfields is then useless in that case.