Skip to content

Commit 2be98fa

Browse files
committed
Move description and comments fields to CustomObjectType model directly, and change it to a NetBoxModel
1 parent fddd431 commit 2be98fa

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,
@@ -161,7 +161,7 @@ def _get_action_url(cls, action=None, rest_api=False, kwargs=None):
161161
return reverse(cls._get_viewname(action, rest_api), kwargs=kwargs)
162162

163163

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

0 commit comments

Comments
 (0)