Skip to content

Commit a2efd96

Browse files
committed
Move description and comments fields to CustomObjectType model directly, and change it to a NetBoxModel
1 parent 17f614e commit a2efd96

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

netbox_custom_objects/models.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
CustomFieldUIVisibleChoices,
2828
)
2929
from extras.models.customfields import SEARCH_TYPES
30-
from netbox.models import ChangeLoggedModel, PrimaryModel
30+
from netbox.models import ChangeLoggedModel, NetBoxModel
3131
from netbox.models.features import (
3232
BookmarksMixin,
3333
ChangeLoggingMixin,
@@ -160,7 +160,7 @@ def _get_action_url(cls, action=None, rest_api=False, kwargs=None):
160160
return reverse(cls._get_viewname(action, rest_api), kwargs=kwargs)
161161

162162

163-
class CustomObjectType(PrimaryModel):
163+
class CustomObjectType(NetBoxModel):
164164
# Class-level cache for generated models
165165
_model_cache = {}
166166
_through_model_cache = (
@@ -186,6 +186,15 @@ class CustomObjectType(PrimaryModel):
186186
),
187187
),
188188
)
189+
description = models.CharField(
190+
verbose_name=_('description'),
191+
max_length=200,
192+
blank=True
193+
)
194+
comments = models.TextField(
195+
verbose_name=_('comments'),
196+
blank=True
197+
)
189198
version = models.CharField(max_length=10, blank=True)
190199
verbose_name = models.CharField(max_length=100, blank=True)
191200
verbose_name_plural = models.CharField(max_length=100, blank=True)

0 commit comments

Comments
 (0)