#18212: GenericIPAddressField does not handle verbose_name and name args like 
other
field types
----------------------------------------------+--------------------
     Reporter:  toofishes                     |      Owner:  nobody
         Type:  Bug                           |     Status:  new
    Component:  Database layer (models, ORM)  |    Version:  1.4
     Severity:  Normal                        |   Keywords:  fields
 Triage Stage:  Unreviewed                    |  Has patch:  1
Easy pickings:  1                             |      UI/UX:  0
----------------------------------------------+--------------------
 Trying to create a field like this fails:

 {{{
     ip_verbose_name = models.GenericIPAddressField("IP Address Verbose",
             blank=True, null=True)
 }}}

 Adding a field definition like this to a test case stops runtests.py dead
 in its tracks:

 {{{
   File "/home/dmcgee/projects/django/django/contrib/comments/models.py",
 line 61, in Comment
     unpack_ipv4=True, blank=True, null=True)
   File "/home/dmcgee/projects/django/django/db/models/fields/__init__.py",
 line 1042, in __init__
     validators.ip_address_validators(protocol, unpack_ipv4)
   File "/home/dmcgee/projects/django/django/core/validators.py", line 130,
 in ip_address_validators
     "You can only use `unpack_ipv4` if `protocol` is set to 'both'")
 ValueError: You can only use `unpack_ipv4` if `protocol` is set to 'both'
 }}}

 Attached is a fix along with added test cases to ensure all core field
 types treat verbose_name correctly.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/18212>
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.

Reply via email to