-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to automatically include DateTimeFields with auto_now enabled #152
base: develop
Are you sure you want to change the base?
Option to automatically include DateTimeFields with auto_now enabled #152
Conversation
@romgar could you please check this feature |
Thanks for your contribution @damjankuznar ! |
hey @romgar, just bumping this up! |
Hi @damjankuznar, The django docs say for fields with
For the first part of your change - adding the option to For the second part of your change - adding the option to def save_dirty_fields(self, extra_update_fields=None):
update_fields = set(self.get_dirty_fields(check_relationship=True).keys())
if extra_update_fields:
update_fields.update(extra_update_fields)
self.save(update_fields=update_fields) Is a better, more flexible option. This allows including other fields that might get modified by You could override |
Add an option to automatically include
DateTimeField
andDateField
withauto_now
set toTrue
to a list of dirty fields in case any other field has changed.