#18247: filter and Decimal equality doesn't work
-------------------------------------+-------------------------------------
Reporter: elmopl@… | Owner: NEOatNHNG
Type: Bug | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: decimal filter | Triage Stage: Accepted
annotate having |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by NEOatNHNG):
* has_patch: 0 => 1
Comment:
On sqlite the SUM() of a decimal column doesn't have a NUMERIC type so
when comparing it to a string literal (which a Decimal gets converted to
in django) it is not compared as NUMERIC as may be expected but as
something else (maybe string?).
I added a CAST to NUMERIC type when using a SQL function that is expected
to return a Decimal.
All tests pass under SQLite.
--
Ticket URL: <https://code.djangoproject.com/ticket/18247#comment:12>
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/074.d5091634c0a720ebe1e039ee3ca492fc%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.