#12890: extra() tables included twice do not generate aliases
---------------------------------------------------+------------------------
Reporter: semenov | Owner: nobody
Status: new | Milestone:
Component: Database layer (models, ORM) | Version: 1.1
Resolution: | Keywords:
Stage: Accepted | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------------+------------------------
Comment (by semenov):
russelim, I'm not picking against the current behavior. I agree that
extra() is an API which allows to push raw SQL parts and thus it's up to a
user to use it properly.
The problem is that extra() is ''documented'' to do particular things but
doesn't do them as advertised. I'm not quite sure why do you say "Building
an alias for an extra() specified table isn't an option". According to the
online documentation, extra() tables are ''supposed'' to get aliases.
Moreover, using aliases is ''suggested'' to a user as a last-chance
solution: "Finally, if all else fails, look at the query produced and
rewrite your where addition to use the alias given to your extra table.
The alias will be the same each time you construct the queryset in the
same way, so you can rely upon the alias name to not change."
We should either make it work as described, or adjust the documentation
accordingly.
--
Ticket URL: <http://code.djangoproject.com/ticket/12890#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.