mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Introduce IPAddressVar and IPAddressWithMaskVar
This commit is contained in:
@@ -3,7 +3,7 @@ from django.db import models
|
||||
from netaddr import AddrFormatError, IPNetwork
|
||||
|
||||
from . import lookups, validators
|
||||
from .formfields import IPFormField
|
||||
from .formfields import IPNetworkFormField
|
||||
|
||||
|
||||
class BaseIPField(models.Field):
|
||||
@@ -33,7 +33,7 @@ class BaseIPField(models.Field):
|
||||
return str(self.to_python(value))
|
||||
|
||||
def form_class(self):
|
||||
return IPFormField
|
||||
return IPNetworkFormField
|
||||
|
||||
def formfield(self, **kwargs):
|
||||
defaults = {'form_class': self.form_class()}
|
||||
|
||||
Reference in New Issue
Block a user