#16937: Prefetch related objects
-------------------------------------+-------------------------------------
Reporter: lukeplant | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: 1.3
(models, ORM) | Resolution: fixed
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by lukeplant):
Replying to [comment:26 mkai]:
> Do you think prefetching the objects behind generic foreign keys (not
their relations) could/ should be added to `prefetch_related`? Or does it
rather belong into `django.contrib.contenttypes`, as `prefetch_generic`
maybe?
This may be possible. I do not want to add more code into Django core that
special-cases anything in contenttypes - we want to go in the opposite
direction to that. We have some work going on regarding composite fields -
see https://www.djangoproject.com/weblog/2011/apr/25/gsoc/ and #373. After
this is done, we are hoping that things like `GenericForeignKey` can be
cleaned up. Then maybe we can find some API whereby prefetch_related (or
possibly select_related) will be able to handle them better.
An alternative, as you say, might be something like 'prefetch_generic'.
But whether this will be easy to implement (or use) if it is not part of
core is another matter.
--
Ticket URL: <https://code.djangoproject.com/ticket/16937#comment:27>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.