1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Add IPNetworkVar

This commit is contained in:
Jeremy Stretch
2019-08-13 09:48:51 -04:00
parent 3d6a583ce4
commit dab30f50d3

View File

@ -7,6 +7,7 @@ from django.conf import settings
from django.core.validators import RegexValidator
from django.db import transaction
from ipam.formfields import IPFormField
from utilities.exceptions import AbortTransaction
from .constants import LOG_DEFAULT, LOG_FAILURE, LOG_INFO, LOG_SUCCESS, LOG_WARNING
from .forms import ScriptForm
@ -18,6 +19,7 @@ __all__ = [
'IntegerVar',
'BooleanVar',
'ObjectVar',
'IPNetworkVar',
]
@ -116,6 +118,17 @@ class ObjectVar(ScriptVariable):
self.field_attrs['queryset'] = queryset
class IPNetworkVar(ScriptVariable):
"""
An IPv4 or IPv6 prefix.
"""
form_field = IPFormField
#
# Scripts
#
class Script:
"""
Custom scripts inherit this object.