#811: IPv6 address field support -------------------------------------+------------------------------------- Reporter: | Owner: erikr mattimustang@… | Status: assigned Type: New | Component: Core (Other) feature | Severity: Normal Milestone: | Keywords: ipv6 IPAddressField Version: SVN | dceu2011 Resolution: | Has patch: 1 Triage Stage: Accepted | Needs tests: 0 Needs documentation: 0 | Easy pickings: 0 Patch needs improvement: 0 | UI/UX: 0 | -------------------------------------+------------------------------------- Changes (by erikr):
* keywords: ipv6 IPAddressField => ipv6 IPAddressField dceu2011 * needs_better_patch: 1 => 0 * ui_ux: => 0 * status: new => assigned * needs_docs: 1 => 0 Comment: I have attached a new patch for this. I believe this addresses all issues. Unlike some of the previous patches, this adds one new field, the IPv46AddressField, that supports both IPv4 and IPv6 addresses. For me, it is very unpleasant to have to use two fields, one for IPv4 and one for IPv6, every time I need to store an IP address. The form field has optional parameters to limit it to only IPv4 or only IPv6. So it is still trivial to create a field for IPv6 addresses only, if you want that. With it's IPv4-only mode, this can therefore replace IPAddressField For naming, I settled on IPv46Address for the reasons: * The field will support both IPv4 and IPv6 * Any kind of generic naming may be unclear * Generic naming may land us in the same issue as with IPAddressField: due to some new invention, the field is incomplete, but we can't change it * IPv46AddressField is a bit more readable than IP46AddressField, and fits closer with existing convention The form field, in it's to_python(), normalises the value that it has, so "2001:0::2" will be turned into "2001::2", as recommended by the RFCs. The rationale for this behaviour is that if one user enters "2001:0::2" and another enters "2001::2", in most cases, I want that to be turned into the same record. The behaviour can be disabled with an optional parameter. I have added docs and pretty extensive tests, so I believe the patch is complete. -- Ticket URL: <https://code.djangoproject.com/ticket/811#comment:54> 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 django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.