#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 anonymous):

 Replying to [comment:4 anonymous]:
 > Replying to [comment:3 aaugustin]:
 > > I'm not sure it's possible to implement the behavior you expect — with
 a reasonable amount of work, that is :(
 > >
 > > Of course, you may use raw SQL as a workaround, but that's
 inconvenient.
 > >
 > > The current docs don't say anything IP ranges; they only give examples
 with IP addresses. If we decide we can't support IP ranges, we should add
 a note.
 >
 > 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()?

 Or on the flip side of this if Django does not use any of the inet()
 features in Postgresql or any other database and it compares strings with
 it then why not make IPAddress the same as a CharField with some
 additional regex validation? That would solve this issue and make more
 sense IMO.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16468#comment:5>
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