#33937: Optimize m2m serialization to avoid loading full model instances
--------------------------------------+------------------------------------
Reporter: Gordon Wrigley | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Serialization) | Version: 4.0
Severity: Normal | Resolution:
Keywords: performance | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by Gordon Wrigley):
Replying to [comment:2 Mariusz Felisiak]:
> > When not using natural keys, the handle_m2m_field function(​source)
loads the full object for every entry in the m2m model, when it only needs
the pks.
>
> What about natural keys? They can contain any combination of fields
(also non-unique in general).
It loads the whole objects for the natural key case as well, but I don't
know if that is avoidable, whereas the PK case seems like it should be
easily avoidable (and is also the one I care about :P )
--
Ticket URL: <https://code.djangoproject.com/ticket/33937#comment:3>
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/01070182b1f994c3-e210e5c7-0cd3-4bdc-93f7-0f5426d06da7-000000%40eu-central-1.amazonses.com.