#34421: QuerySet.update() on querysets in descending order by annotations.
-------------------------------------+-------------------------------------
Reporter: WE1 | Owner: WE1
Type: Bug | Status: assigned
Component: Database | Version: 4.1
layer (models, ORM) |
Severity: Normal | Keywords: update,order_by
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
When I execute
{{{
Model.objects.annotate(message_length=Length('message')).order_by('-message_length').update(text="Can
I come on board?")
}}}
I get the error
{{{
FieldError: Cannot resolve keyword 'message_length' into field. Choices
are: message, id, text, x
}}}
because the code ignores the descending case.
--
Ticket URL: <https://code.djangoproject.com/ticket/34421>
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 on the web visit
https://groups.google.com/d/msgid/django-updates/01070186f09b4a5c-78097e30-898d-4074-94e8-7d75b459589b-000000%40eu-central-1.amazonses.com.