Browse Source

Fix casting in form to_python() method

NetAddressFormField.to_python() was calling "self.python_type()" to
cast the form value to an IP() object. Unfortunately, for is no such
method defined here, or in the Django forms.Field() class, at least
in 1.4 and up
jimfunk 12 years ago
parent
commit
cf026dbabf
1 changed files with 1 additions and 1 deletions
  1. 1 1
      netfields/forms.py

+ 1 - 1
netfields/forms.py

@@ -35,7 +35,7 @@ class NetAddressFormField(forms.Field):
         if isinstance(value, IP):
             return value
 
-        return self.python_type(value)
+        return IP(value)
 
 
 MAC_RE = re.compile(r'^(([A-F0-9]{2}:){5}[A-F0-9]{2})$')