#25456: GenericIPAddressField does not normalize IPv4 addresses
-------------------------------------+-------------------------------------
     Reporter:  frankvdp             |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  Database layer       |                  Version:  1.8
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  ipaddress, ipv4,     |             Triage Stage:
  database, normalization            |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by frankvdp):

 Replying to [comment:1 timgraham]:
 > Does the behavior change justify breaking backwards compatibility
 (silently changing the input value)? Perhaps so, considering that
 PostgreSQL (and its native IP address data type) won't let you store
 duplicate values. It reports "Key (ip)=(192.168.1.10) already exists." for
 the two addresses you proposed -- so is the proper normalization to remove
 the leading zero?

 To start off, I do not really if you're advocating pro or con :-) But, I
 think the current situation is pretty bad. I mean, people can create
 models with an addresses which they think have unique values. And in a
 sense this also goes against what you expect. You expect an generic ip
 address object to be evaluated as such, as an ip address, and not as a
 mere string value because it is stored as such. As far as I know, there is
 also not mention of this in the current documentation.

 So, I also don't think that preserving backwards compatibility
 preservation is doing anyone a service in this matter. This might leave
 people having unreliable data.

--
Ticket URL: <https://code.djangoproject.com/ticket/25456#comment:2>
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/066.2886c4ef1639d4014a77309a482f0ecd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to