#16468: Django IPAddressField incorrectly casts values when querying
-------------------------------------+-------------------------------------
               Reporter:  anonymous  |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Milestone:             |      Component:  Database layer
                Version:  1.3        |  (models, ORM)
             Resolution:             |       Severity:  Normal
           Triage Stage:  Design     |       Keywords:
  decision needed                    |      Has patch:  0
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------

Comment (by aaugustin):

 Replying to [comment:4 anonymous]:
 > Would it really be that hard to make a way to specify types when
 querying fields? Django knows not to cast integers to strings when
 querying an integer field, so if it is querying against a IPAddressField
 then just wrap the data in Host()?

 AFAIX, that depends on the type of the data you pass, not the type of the
 target field, and `type("192.168.1.1/28") == str`.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16468#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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to