#37047: Crash in Query.orderby_issubset_groupby for descending and random 
order_by
strings
-------------------------------------+-------------------------------------
     Reporter:  Anže Pečar           |                    Owner:  (none)
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by Anže Pečar:

Old description:

> ticket-26434 caused a crash. It can be reproduced with:
>
> {{{
> User.objects.values("is_staff").annotate(latest=Max("date_joined")).order_by("-latest").count()
> }}}
>
> You should see the following exception:
>
> {{{
> django.core.exceptions.FieldError: Cannot resolve keyword '-latest' into
> field. Choices are: activity_logs, date_joined, email, first_name,
> groups, id, is_active, is_administrator, is_staff, is_superuser,
> last_login, last_name, latest, logentry, module_access, password,
> user_permissions, username
> }}}

New description:

 #26434 caused a crash. It can be reproduced with:

 {{{
 
User.objects.values("is_staff").annotate(latest=Max("date_joined")).order_by("-latest").count()
 }}}

 You should see the following exception:

 {{{
 django.core.exceptions.FieldError: Cannot resolve keyword '-latest' into
 field. Choices are: activity_logs, date_joined, email, first_name, groups,
 id, is_active, is_administrator, is_staff, is_superuser, last_login,
 last_name, latest, logentry, module_access, password, user_permissions,
 username
 }}}

--
-- 
Ticket URL: <https://code.djangoproject.com/ticket/37047#comment:1>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019da0757587-4ac4493a-2458-497e-b950-5d128beb1f53-000000%40eu-central-1.amazonses.com.

Reply via email to