It's hard to think about what this would look like, but it could look
something like:
{{{#!python
>>> user.groups.set(users)
>>> user.groups._cache == users # Very explicit, unlikely to mesh well
with future access code
... True
>>> user.groups.all() == users # Via prefetch cache. Nicer but could be
confusing
... True
>>> user.groups.save() # explicit commit
>>> user.save_pending_m2m() # saves all m2ms with a pending update
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27503>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Accepted
Comment:
*-to-one relationships support attaching unsaved objects; it would be nice
to do something similar for *-to-many relationships.
--
Ticket URL: <https://code.djangoproject.com/ticket/27503#comment:1>