          self.default_error_messages['invalid'] = invalid_error_message
          super(GenericIPAddressField, self).__init__(*args, **kwargs)
  
      def to_python(self, value):
          if not value:
              return ''
          if value and ':' in value:
                  return clean_ipv6_address(value,
                      self.unpack_ipv4, self.error_messages['invalid'])
          return value
  
 
</s> remove     generic_ip = models.GenericIPAddressField(blank=True, unique=True)
    v4_ip = models.GenericIPAddressField(blank=True, protocol="ipv4")
    v6_ip = models.GenericIPAddressField(blank=True, protocol="ipv6")
 </s> add     generic_ip = models.GenericIPAddressField(blank=True, null=True, unique=True)
    v4_ip = models.GenericIPAddressField(blank=True, null=True, protocol="ipv4")
    v6_ip = models.GenericIPAddressField(blank=True, null=True, protocol="ipv6")
        if value in validators.EMPTY_VALUES:
            return u''
          self.default_error_messages['invalid'] = invalid_error_message
          super(GenericIPAddressField, self).__init__(*args, **kwargs)
  
      def to_python(self, value):
        if value in validators.EMPTY_VALUES:
            return u''
        if value in validators.EMPTY_VALUES:
            return u''
          if value and ':' in value:
                  return clean_ipv6_address(value,
                      self.unpack_ipv4, self.error_messages['invalid'])
          return value
  
keep keep keep keep replace replace keep keep keep keep keep
 Fixed #16246 -- Fixed GenericIPAddressField tests on PostgreSQL.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16395 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/forms/fields.py