#19816: Assigning a QS to a M2M relation that was generated from that M2M
relation
clears both the QS and the relation
-------------------------------------+-------------------------------------
Reporter: jedediah | Owner: ethlinn
Type: Bug | Status: closed
Component: Database layer | Version: 1.4
(models, ORM) | Resolution: fixed
Severity: Normal | Triage Stage: Ready for
Keywords: sprint2013 | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Loic Bistuer <loic.bistuer@…>):
In [changeset:"20399083f49faceef1e48530822137257bca9d6a"]:
{{{
#!CommitTicketReference repository=""
revision="20399083f49faceef1e48530822137257bca9d6a"
Fixed #19816 -- Pre-evaluate querysets used in direct relation
assignments.
Since assignments on M2M or reverse FK descriptors is composed of a
`clear()`,
followed by an `add()`, `clear()` could potentially affect the value of
the
assigned queryset before the `add()` step; pre-evaluating it solves the
problem.
This patch fixes the issue for ForeignRelatedObjectsDescriptor,
ManyRelatedObjectsDescriptor, and ReverseGenericRelatedObjectsDescriptor.
It completes 6cb6e1 which addressed ReverseManyRelatedObjectsDescriptor.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/19816#comment:8>
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/066.f48d8ec0f6ff79ffc5235690e8cf9865%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.