[Django] #27503: Provide a way for to-many rels to be used without the db

13 views
Skip to first unread message

Django

unread,
Nov 18, 2016, 9:15:39 AM11/18/16
to django-...@googlegroups.com
#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.

Django

unread,
Nov 18, 2016, 9:30:55 AM11/18/16
to django-...@googlegroups.com
#27503: Provide a way for to-many rels to be used without the db
-------------------------------------+-------------------------------------
Reporter: Marc Tamlyn | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Aymeric Augustin):

* 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>

Reply all
Reply to author
Forward
0 new messages