#33312: Instances with deferred fields cannot be used for copying.
-------------------------------------+-------------------------------------
Reporter: Adam Sołtysik | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):
* type: Bug => Cleanup/optimization
* stage: Unreviewed => Accepted
Comment:
Thanks for the report. Instances with deferred fields cannot be used for
copying model instances, because ''"When calling save() for instances with
deferred fields, only the loaded fields will be saved"'' (see
[https://docs.djangoproject.com/en/3.2/ref/models/querysets/#defer docs]).
It's niche and I don't think it's worth changing, or even if it's feasible
with backward compatibility, we can add a warning to the ''"Copying model
instances"'' section, e.g. `Instances with deferred fields cannot be used
....`.
--
Ticket URL: <https://code.djangoproject.com/ticket/33312#comment:2>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.f5e66fc05df06fd6647c2ab27ae79313%40djangoproject.com.