#27503: Provide a way for to-many rels to be used without the db
-------------------------------------+-------------------------------------
Reporter: Marc | Owner: nobody
Tamlyn |
Type: New | Status: new
feature |
Component: Database | Version: master
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
ManyToMany or reverse to many relationships should have a reasonable way
to interact with them without them touching the database.
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.
--
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/051.791b67324c68af01ab7556d4a13f4779%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.