queryset .extra(tables=[...]) unnecessarily quotes table names
|Reported by:||Tobias McNulty||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||1.0|
|Cc:||elsdoerfer@…, sciyoshi@…||Triage Stage:||Accepted|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
A while back I could happily pass subqueries, joins, and even pl/pgsql calls in through the queryset .extra() method, via the tables parameter. Sometime in the past few months that changed, when Django began quoting the "table names" i passed it.
Why does Django need to do this? I can quote the table names myself if I know them to need such treatment--and not doing it by default opens up a lot of possibilities for the .extra method and Django ORM in general.
Alternatively, to avoid breaking existing code, we could add an option to .extra that told it not to quote table names.
Change History (9)
comment:1 Changed 8 years ago by
|Patch needs improvement:||unset|
|Triage Stage:||Unreviewed → Accepted|