~ubuntu-branches/ubuntu/raring/python-django/raring

« back to all changes in this revision

Viewing changes to django/db/models/fields/__init__.py

  • Committer: Package Import Robot
  • Author(s): Raphaël Hertzog
  • Date: 2012-10-22 10:53:30 UTC
  • mfrom: (1.1.18) (4.4.22 sid)
  • Revision ID: package-import@ubuntu.com-20121022105330-ql62yy1dl71mbip8
Tags: 1.4.2-1
* New upstream security and maintenance release. Closes: #691145
  Fixes: CVE-2012-4520
* Drop 01_use_stdlib_htmlparser_when_possible.diff which has been
  merged upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1023
1023
    description = _("IP address")
1024
1024
    default_error_messages = {}
1025
1025
 
1026
 
    def __init__(self, protocol='both', unpack_ipv4=False, *args, **kwargs):
 
1026
    def __init__(self, verbose_name=None, name=None, protocol='both',
 
1027
                 unpack_ipv4=False, *args, **kwargs):
1027
1028
        self.unpack_ipv4 = unpack_ipv4
1028
1029
        self.default_validators, invalid_error_message = \
1029
1030
            validators.ip_address_validators(protocol, unpack_ipv4)
1030
1031
        self.default_error_messages['invalid'] = invalid_error_message
1031
1032
        kwargs['max_length'] = 39
1032
 
        Field.__init__(self, *args, **kwargs)
 
1033
        Field.__init__(self, verbose_name, name, *args, **kwargs)
1033
1034
 
1034
1035
    def get_internal_type(self):
1035
1036
        return "GenericIPAddressField"