#4102: Allow UPDATE of only specific fields in model.save()
-------------------------------------+-------------------------------------
Reporter: Collin Grady | Owner: cgrady
<cgrady@…> | Status: new
Type: New feature | Version: master
Component: Database layer | Resolution:
(models, ORM) | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
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 aaugustin):
The code looks generally sane to me.
A few remarks:
* Does the code behave properly with related models -- ie. you can
`save(update_fields=['related'])` rather than
`save(update_fields=['related_id'])`? I haven't seen a test for this.
* There are tests for inherited models, which is a good idea. I'm not
sufficiently familiar with the implementation of the ORM to tell if other
features (like proxy models) are worth testing. If you think they are, a
few more tests would be nice.
* This isn't a minor feature, it deserves a full paragraph in the release
notes.
* `tests/modeltests/update_only_fields/__init__.py` should be totally
empty.
--
Ticket URL: <https://code.djangoproject.com/ticket/4102#comment:87>
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.