#29256: Need a save() call after assigning a many to many relation
-------------------------------------+-------------------------------------
Reporter: Victor Porton | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):
* status: new => closed
* resolution: => invalid
Comment:
The blog post is incorrect. A second save isn't needed. Also, that code
won't work in Django 2.0 and later which removed support for
[https://docs.djangoproject.com/en/dev/releases/1.10/#direct-assignment-
to-a-reverse-foreign-key-or-many-to-many-relation direct assignment to
many to many relations].
The blog post should use `foo.child.set(parts)` as described
[https://docs.djangoproject.com/en/stable/topics/db/examples/many_to_many/
in the documentation].
In the future, please use [wiki:TicketClosingReasons/UseSupportChannels
our support channels] to ask "is it a bug?" questions.
--
Ticket URL: <https://code.djangoproject.com/ticket/29256#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 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/065.29c38054d1be5369d220fb83b4c61df4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.