#24508: F() object operations do not correcly reflect with annotate
-------------------------------------+-------------------------------------
Reporter: mijamo | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.8rc1
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: F() | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by jarshwah):
Part of this problem will be solved by
https://github.com/django/django/pull/4349
{{{
SomeModel.objects.all().annotate(computed = ExpressionWrapper(None +
F('some_field'), output_field = FloatField()))
}}}
Where `ExpressionWrapper` replaces your previous (and incorrectly
documented) `Expression`.
The second part, where you get different results depending on which node
is left or right could possibly be fixed, but we may not be able to if it
results in backwards compatibility problems.
What is the field type of `some_field` in your example? An integer or
float?
--
Ticket URL: <https://code.djangoproject.com/ticket/24508#comment:2>
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/064.e1111ec75b9c514eabb2f404b4b71990%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.