{{{#!python
Book.objects.annotate(annotation=Value(1)).values("annotation_type")
}}}
The resulting `FieldError` doesn't mention `annotation` as a valid choice
{{{#!python
FieldError: Cannot resolve keyword 'annotation_typo' into field. Choices
are: age, book, book_contact_set, friends, id, name
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34437>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: nobody => Simon Charette
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/34437#comment:1>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"cb13792938f2c887134eb6b5164d89f8d8f9f1bd" cb137929]:
{{{
#!CommitTicketReference repository=""
revision="cb13792938f2c887134eb6b5164d89f8d8f9f1bd"
Fixed #34437 -- Made values() resolving error mention selected
annotations.
While the add_fields() call from set_values() does trigger validation it
does so after annotations are masked resulting in them being excluded
from the choices of valid options surfaced through a FieldError.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34437#comment:2>