Skip to content

Conversation

Timvde
Copy link

@Timvde Timvde commented Sep 2, 2022

No description provided.

This makes the code slightly more readable, and in the future reusable.
This makes the code slightly more readable, and in the future reusable.
Because this may not be what people want, a global setting is created.
The default is False for consistency reasons with using update_fields.
We create an extra class that can be used when the user wants to always
save only dirty fields when calling save().
@Timvde
Copy link
Author

Timvde commented Sep 2, 2022

Sorry, I wanted to create this pull request on our local fork 😅 But if you would want to upstream anything of this, feel free :)

@Timvde Timvde closed this Sep 2, 2022
@Timvde
Copy link
Author

Timvde commented Sep 2, 2022

It is based on #152, but:

  • Without support for FIELDS_TO_CHECK
  • A bit more structured than using the SKIP_FIELD object, which I personally disliked
  • It uses django settings for the auto_now behaviour.
  • With an extra DefaultDirtyFieldsMixin, which overrides save() by default, which is what we want, but which is also the reason why I don't expect this to be ever upstreamed :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant