Commit 13eccfe6 authored by Jelle van der Waa's avatar Jelle van der Waa 🚧
Browse files

Stop using deprecated SubFieldBase

parent c7681318
......@@ -18,7 +18,6 @@ def to_python(self, value):
class IPNetworkField(models.Field):
__metaclass__ = models.SubfieldBase
description = "IPv4 or IPv6 address or subnet"
def __init__(self, *args, **kwargs):
......@@ -43,3 +42,6 @@ def formfield(self, **kwargs):
defaults = {'form_class': IPNetworkFormField}
return super(IPNetworkField, self).formfield(**defaults)
def from_db_value(self, value, expression, connection, context):
return self.to_python(value)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment