#25086: Allow mass-update of fields in unpersisted model instances
-------------------------------------+-------------------------------------
Reporter: yoongkang | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by timgraham):
I don't like the idea of silently ignoring values from `values_dict` if
they don't existing in fields. It seems this would make typos more
difficult to debug.
Overall, I don't have a strong opinion on whether or not this should be
part of Django, so I'd suggest to write to the DevelopersMailingList to
get some opinions. However, if we get rid of the fields logic, it seems
this boils down to two lines:
{{{
for k, v in values_dict.items():
setattr(instance, k, v)
}}}
so the value of adding a method for that doesn't seem significant. Of
course, you can create a model mixin if you really want it in your own
project.
--
Ticket URL: <https://code.djangoproject.com/ticket/25086#comment:4>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.f6ed5df7b6dbbbfb986f55ad0efd9291%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.