Comment (by 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).
--
Ticket URL: <https://code.djangoproject.com/ticket/33937#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
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>
* owner: nobody => marknotfound
* status: new => assigned
Comment:
Going to take this on as my first Django ticket. Should have a patch
shortly.
--
Ticket URL: <https://code.djangoproject.com/ticket/33937#comment:4>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/33937#comment:5>
Comment (by mark evans):
I've submitted a patch here: https://github.com/django/django/pull/16028
--
Ticket URL: <https://code.djangoproject.com/ticket/33937#comment:6>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/33937#comment:7>
* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/33937#comment:8>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"19e0587ee596debf77540d6a08ccb6507e60b6a7" 19e0587e]:
{{{
#!CommitTicketReference repository=""
revision="19e0587ee596debf77540d6a08ccb6507e60b6a7"
Fixed #33937 -- Optimized serialization of related m2m fields without
natural keys.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33937#comment:9>