ProgrammingError: column "adas" does not exist
LINE 1: ...arch3_beleg"."id" FROM "modarch3_beleg" ORDER BY (adas) ASC ...
}}}
There's already a similar ticket (but it's closed as fixed)
https://code.djangoproject.com/ticket/14930
--
Ticket URL: <https://code.djangoproject.com/ticket/26185>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => wontfix
* needs_tests: => 0
* needs_docs: => 0
Comment:
As noted
[https://docs.djangoproject.com/en/1.9/ref/models/querysets/#django.db.models.query.QuerySet.extra
in the docs], we aren't fixed bugs that involved `QuerySet.extra()`.
--
Ticket URL: <https://code.djangoproject.com/ticket/26185#comment:1>
Comment (by srkunze):
How are we supposed to construct such queries then (asking as noted in the
docs)?
As usual the given example is minimal: so the actual **working** flow goes
like this:
{{{
# create complex queryset
... more code
# add extra column
... more code
# add order (maybe referring to extra column)
... more code
# create values_list queryset
... more code
# evaluate <<<< crash
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26185#comment:2>
Comment (by timgraham):
If you have trouble using the
[https://docs.djangoproject.com/en/stable/ref/models/expressions/
expressions API], please ask using our support channels:
TicketClosingReasons/UseSupportChannels.
--
Ticket URL: <https://code.djangoproject.com/ticket/26185#comment:3>
Comment (by srkunze):
I was able to rewrite the extra statement using a combination of
Expression (for select) and extra (for where). So, I think we are set for
now.
If you really consider deprecating extra, there would need to be a
facility to add custom where clauses.
--
Ticket URL: <https://code.djangoproject.com/ticket/26185#comment:4>
Comment (by srkunze):
@timgraham thanks for pointing me at the docs. :)
--
Ticket URL: <https://code.djangoproject.com/ticket/26185#comment:5>