Opened 5 years ago

Last modified 5 years ago

#26215 closed Bug

if dumpdata FloatRangeField and IntegerRangeField values = "None" and post loaddata is ValidationError — at Initial Version

Reported by: Алексей Owned by: nobody
Component: contrib.postgres Version: 1.9
Severity: Normal Keywords:
Cc: Алексей Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


  1. FloatRangeField db data == None
  2. ./manage dumpdata
  3. ./manage loaddata

Conversion problem. accept string u'None' to float type


File "/local/lib/python2.7/site-packages/django/db/models/fields/", line 1803, in to_python

params={'value': value},


    def to_python(self, value):
        if value == u'None':
            return None
        elif value is None:
            return value
            return int(value)
        except (TypeError, ValueError):
            raise exceptions.ValidationError(
                params={'value': value},

And IntegerField too

Source data dump example:

<field name="rate" type="FloatRangeField">{"upper": "None", "lower": "1.45", "bounds": "[)"}</field>

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top