def clean(self, value): ip_string = super(IPv4Field, self).clean(value) if ip_string: return ip_interface(ip_string) return None