#28072: Cannot annotate exisiting field
-------------------------------------+-------------------------------------
Reporter: Marcin | Owner: nobody
Nowak |
Type: Bug | Status: new
Component: Database | Version: 1.8
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Because of this exception
https://github.com/django/django/blob/master/django/db/models/query.py#L900
I can't add annotation.
I need to >rename< db_field within the query and fetch results by
.values() / .values_list(), so mapping db values to fields is not
required.
Queries like "select x as y, y as x from table" are valid, and as a Django
user I want to do similar things using queryset API, for my own
responsibility.
Please add possibility to bypass the constraint somehow, or move this
constraint elsewhere and activiate it when no .values()/.values_list() are
used. Also please backport the change to the 1.8.x branch.
Thank you.
--
Ticket URL: <https://code.djangoproject.com/ticket/28072>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/050.7acf49b5f87de5f192b4243a3edc6d13%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.