#4102: Allow UPDATE of only specific fields in model.save()
-------------------------------------+-------------------------------------
Reporter: Collin Grady | Owner: cgrady
<cgrady@…> | Status: new
Type: New feature | Version: SVN
Component: Database layer | Resolution:
(models, ORM) | Triage Stage: Accepted
Severity: Normal | Needs documentation: 1
Keywords: update fields sql | Patch needs improvement: 1
row table modified | UI/UX: 0
Has patch: 1 |
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Comment (by mattlong):
After reviewing the history of this ticket, it seems what started as a
simple opt-in feature request of adding a field white-list to the Model's
save function morphed into a complicated dirty flag approach that
obviously has many edge cases and performance implications given that this
ticket has been open for 5 years now. Just compare the very first proposed
patch to the latest to see what I mean.
Unfortunately, this seemed to have happened without much discussion about
the relative merits of each approach. I would prefer the Django ORM leave
it to me to decide which fields I would like to update rather than relying
on it to correctly infer which fields I would like updated. Clearly some
people differently and favor the dirty flag approach for a more hands-off
approach. As such, I propose adding support for both methods so that
developers can choose the right approach for their use case.
--
Ticket URL: <https://code.djangoproject.com/ticket/4102#comment:69>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.