#25344: prefetch_related() and add() on related field
-------------------------------------+-------------------------------------
Reporter: TankOs | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.8
(models, ORM) |
Severity: Normal | Resolution:
Keywords: prefetch_related | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by TankOs):
Replying to [comment:1 timgraham]:
> I don't know that it's a problem worth the possibility of breaking
existing code for (either by disallowing or by modifying the prefetch
cache), but other opinions welcome.
The question is what the expected behavior is. From a logical standpoint,
it's for sure returning all possible objects when `all()` is called,
because the name implies ''all possible related objects''. From a
technical point this might differ, as I probably don't want new objects to
be included within a cache that has already been filled (by the actual
`prefetch_related` call).
Whatever it's going to be, at least some documentation is required. I
might be the first one to run into this, but I can tell you that I had a
really long debugging session before I found the cause of my issue. ;-)
(By the way, I'd be happy to provide a patch once this has been decided.)
--
Ticket URL: <https://code.djangoproject.com/ticket/25344#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/064.7850f48182c62cef13a6bfe1086f8ec7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.