Closed vmx closed 3 years ago
auto_now_add=True
makes absolutely sure that you can't override the timestamp later on (unless you bypass the save method entirely), so that wouldn't be an option.
I think a better place for this would be in the form.
form.changed_data
holds a list of things that have actually changed, and we could test for those.
Thanks, I'll try to put it there.
auto_now_add=True
makes absolutely sure that you can't override the timestamp later on (unless you bypass the save method entirely), so that wouldn't be an option.
The above alternative worked for me, I tried it locally. Though I'll try it the recommended way as mentioned above.
I've moved it from the model into the form. Sadly form.has_changed()
didn't work as expected, hence I've added a manual comparison.
I'm not sure if that's the right approach.
An alternative version I had was: