#36031: DecimalRangeField __contains query for a value causes DataError
----------------------------------+--------------------------------------
     Reporter:  Trent Holliday    |                    Owner:  (none)
         Type:  Bug               |                   Status:  new
    Component:  contrib.postgres  |                  Version:  4.2
     Severity:  Normal            |               Resolution:
     Keywords:                    |             Triage Stage:  Unreviewed
    Has patch:  0                 |      Needs documentation:  0
  Needs tests:  0                 |  Patch needs improvement:  0
Easy pickings:  0                 |                    UI/UX:  0
----------------------------------+--------------------------------------
Comment (by amansharma612):

 I think the mentioned cause is correct. Note that
 
[https://github.com/django/django/blob/fcd9d08379a2aee3b2c49eab0d0b8db6fd66d091/django/db/backends/postgresql/base.py#L104]
 maps to the column type to "numeric(%(max_digits)s, %(decimal_places)s)",
 and the fields are populated here
 
[https://github.com/django/django/blob/fcd9d08379a2aee3b2c49eab0d0b8db6fd66d091/django/db/models/fields/__init__.py#L886].

 Though I am not sure of a way to fix this, but would be happy to open a PR
 if given direction.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36031#comment:3>
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 visit 
https://groups.google.com/d/msgid/django-updates/01070193f7929081-56ee192d-fcf0-42f4-bf81-bad34813a9a2-000000%40eu-central-1.amazonses.com.

Reply via email to