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

 * cc: Simon Charette, Mariusz Felisiak (added)
 * stage:  Unreviewed => Accepted
 * version:  4.2 => dev

Comment:

 I've been reading the comments and analyzing this ticket to complete the
 triage. I think this is a valid tickets, I can reproduce the issue.

 But to me, the correct solution is to be to ensure that a
 `DecimalRangeField` is created with valid `max_digits` and
 `decimal_places`. This would mean extending the `DecimalRangeField` to
 receive and use these parameters, and adding system checks that mimic the
 current ones for `DecimalField`:

 {{{
 $ python -Wall manage.py makemigrations
 SystemCheckError: System check identified some issues:

 ERRORS:
 testapp.Ticket36031Model.decimal_plain: (fields.E130) DecimalFields must
 define a 'decimal_places' attribute.
 testapp.Ticket36031Model.decimal_plain: (fields.E132) DecimalFields must
 define a 'max_digits' attribute.
 }}}

 Simon, Mariusz, what do you think?
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36031#comment:8>
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/01070194040862c7-d80a1ce6-85b0-4b1b-8864-056a090f7350-000000%40eu-central-1.amazonses.com.

Reply via email to