#25591: Cannot QuerySet.update DateRangeField using F() expressions
----------------------------------+------------------------------------
     Reporter:  synotna           |                    Owner:  nobody
         Type:  New feature       |                   Status:  new
    Component:  contrib.postgres  |                  Version:  1.8
     Severity:  Normal            |               Resolution:
     Keywords:                    |             Triage Stage:  Accepted
    Has patch:  0                 |      Needs documentation:  0
  Needs tests:  0                 |  Patch needs improvement:  0
Easy pickings:  0                 |                    UI/UX:  0
----------------------------------+------------------------------------

Comment (by Simon Charette):

 It looks like `FloatRangeField` should actually have been called
 `DecimalRangeField` because `FloatField`s are stored as `double precision`
 aka `float` and `DecimalField` are stored as `numeric`. `FloatRangeField`
 is stored as `numrange` which only accepts `numeric` values.

 The crash you are getting here is because `numrange(float, float)` simply
 doesn't exist. If you want to get it working I suggest you either switch
 to using `DecimalField`s or use `Cast`s.

 {{{#!python
 update(age_range=AgeRange(Cast('age_min', DecimalField()), Cast('age_max',
 DecimalField())))
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/25591#comment:6>
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/065.c8b9c3c9732c9921996430aa1281c13b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to