|
|
@@ -7,7 +7,6 @@ from django.utils.translation import gettext_lazy as _
|
|
|
from extras.models import *
|
|
|
from netbox.constants import EMPTY_TABLE_TEXT
|
|
|
from netbox.tables import BaseTable, NetBoxTable, columns
|
|
|
-from .template_code import *
|
|
|
|
|
|
__all__ = (
|
|
|
'BookmarkTable',
|
|
|
@@ -72,13 +71,26 @@ class CustomFieldTable(NetBoxTable):
|
|
|
is_cloneable = columns.BooleanColumn(
|
|
|
verbose_name=_('Is Cloneable'),
|
|
|
)
|
|
|
+ validation_minimum = tables.Column(
|
|
|
+ verbose_name=_('Minimum Value'),
|
|
|
+ )
|
|
|
+ validation_maximum = tables.Column(
|
|
|
+ verbose_name=_('Maximum Value'),
|
|
|
+ )
|
|
|
+ validation_regex = tables.Column(
|
|
|
+ verbose_name=_('Validation Regex'),
|
|
|
+ )
|
|
|
+ validation_unique = columns.BooleanColumn(
|
|
|
+ verbose_name=_('Validate Uniqueness'),
|
|
|
+ )
|
|
|
|
|
|
class Meta(NetBoxTable.Meta):
|
|
|
model = CustomField
|
|
|
fields = (
|
|
|
'pk', 'id', 'name', 'object_types', 'label', 'type', 'related_object_type', 'group_name', 'required',
|
|
|
'default', 'description', 'search_weight', 'filter_logic', 'ui_visible', 'ui_editable', 'is_cloneable',
|
|
|
- 'weight', 'choice_set', 'choices', 'comments', 'created', 'last_updated',
|
|
|
+ 'weight', 'choice_set', 'choices', 'validation_minimum', 'validation_maximum', 'validation_regex',
|
|
|
+ 'validation_unique', 'comments', 'created', 'last_updated',
|
|
|
)
|
|
|
default_columns = ('pk', 'name', 'object_types', 'label', 'group_name', 'type', 'required', 'description')
|
|
|
|