#9578: order_by() removing select_related() joined tables when with extra()
query
sets
---------------------------------------------------+------------------------
Reporter: marinho | Owner: mtredinnick
Status: assigned | Milestone:
Component: Database layer (models, ORM) | Version: 1.0
Resolution: | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------------+------------------------
Comment (by mtredinnick):
The problem description here isn't complete. In the first example, all the
"related" selections are left outer joins. Those aren't ever included when
you just write `select_related()`, only when you explicitly include them
with `select_related("feed", "streamsource")` and similar. In short, the
first fragment of Python code would not be generating the SQL you pasted
unless there's something else going on (like a custom manager).
So can you please post a short, complete (self-contained) example of
models that demonstrate the problem. If I add ordering after a
`select_related()` call to a queryset, the related selections are still
included, so either you forget that you specified explicit related
selections the first time and not the second, or some of the missing
information is important for reproducing the problem.
--
Ticket URL: <http://code.djangoproject.com/ticket/9578#comment:2>
Django <http://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
-~----------~----~----~----~------~----~------~--~---