Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions netbox/circuits/api/serializers_/circuits.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class CircuitTypeSerializer(OrganizationalModelSerializer):
class Meta:
model = CircuitType
fields = [
'id', 'url', 'display_url', 'display', 'name', 'slug', 'color', 'description', 'owner', 'tags',
'id', 'url', 'display_url', 'display', 'name', 'slug', 'color', 'description', 'owner', 'comments', 'tags',
'custom_fields', 'created', 'last_updated', 'circuit_count',
]
brief_fields = ('id', 'url', 'display', 'name', 'slug', 'description', 'circuit_count')
Expand Down Expand Up @@ -71,7 +71,7 @@ class CircuitGroupSerializer(OrganizationalModelSerializer):
class Meta:
model = CircuitGroup
fields = [
'id', 'url', 'display_url', 'display', 'name', 'slug', 'description', 'tenant', 'owner', 'tags',
'id', 'url', 'display_url', 'display', 'name', 'slug', 'description', 'tenant', 'owner', 'comments', 'tags',
'custom_fields', 'created', 'last_updated', 'circuit_count'
]
brief_fields = ('id', 'url', 'display', 'name')
Expand Down Expand Up @@ -161,7 +161,7 @@ class VirtualCircuitTypeSerializer(OrganizationalModelSerializer):
class Meta:
model = VirtualCircuitType
fields = [
'id', 'url', 'display_url', 'display', 'name', 'slug', 'color', 'description', 'owner', 'tags',
'id', 'url', 'display_url', 'display', 'name', 'slug', 'color', 'description', 'owner', 'comments', 'tags',
'custom_fields', 'created', 'last_updated', 'virtual_circuit_count',
]
brief_fields = ('id', 'url', 'display', 'name', 'slug', 'description', 'virtual_circuit_count')
Expand Down
6 changes: 3 additions & 3 deletions netbox/circuits/forms/bulk_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class CircuitTypeBulkEditForm(OrganizationalModelBulkEditForm):
fieldsets = (
FieldSet('color', 'description'),
)
nullable_fields = ('color', 'description')
nullable_fields = ('color', 'description', 'comments')


class CircuitBulkEditForm(PrimaryModelBulkEditForm):
Expand Down Expand Up @@ -241,7 +241,7 @@ class CircuitGroupBulkEditForm(OrganizationalModelBulkEditForm):

model = CircuitGroup
nullable_fields = (
'description', 'tenant',
'description', 'tenant', 'comments',
)


Expand Down Expand Up @@ -274,7 +274,7 @@ class VirtualCircuitTypeBulkEditForm(OrganizationalModelBulkEditForm):
fieldsets = (
FieldSet('color', 'description'),
)
nullable_fields = ('color', 'description')
nullable_fields = ('color', 'description', 'comments')


class VirtualCircuitBulkEditForm(PrimaryModelBulkEditForm):
Expand Down
6 changes: 3 additions & 3 deletions netbox/circuits/forms/bulk_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class CircuitTypeImportForm(OrganizationalModelImportForm):

class Meta:
model = CircuitType
fields = ('name', 'slug', 'color', 'description', 'owner', 'tags')
fields = ('name', 'slug', 'color', 'description', 'owner', 'comments', 'tags')


class CircuitImportForm(PrimaryModelImportForm):
Expand Down Expand Up @@ -176,7 +176,7 @@ class CircuitGroupImportForm(OrganizationalModelImportForm):

class Meta:
model = CircuitGroup
fields = ('name', 'slug', 'description', 'tenant', 'owner', 'tags')
fields = ('name', 'slug', 'description', 'tenant', 'owner', 'comments', 'tags')


class CircuitGroupAssignmentImportForm(NetBoxModelImportForm):
Expand All @@ -199,7 +199,7 @@ class VirtualCircuitTypeImportForm(OrganizationalModelImportForm):

class Meta:
model = VirtualCircuitType
fields = ('name', 'slug', 'color', 'description', 'owner', 'tags')
fields = ('name', 'slug', 'color', 'description', 'owner', 'comments', 'tags')


class VirtualCircuitImportForm(PrimaryModelImportForm):
Expand Down
6 changes: 3 additions & 3 deletions netbox/circuits/forms/model_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class CircuitTypeForm(OrganizationalModelForm):
class Meta:
model = CircuitType
fields = [
'name', 'slug', 'color', 'description', 'tags',
'name', 'slug', 'color', 'description', 'comments', 'tags',
]


Expand Down Expand Up @@ -236,7 +236,7 @@ class CircuitGroupForm(TenancyForm, OrganizationalModelForm):
class Meta:
model = CircuitGroup
fields = [
'name', 'slug', 'description', 'tenant_group', 'tenant', 'owner', 'tags',
'name', 'slug', 'description', 'tenant_group', 'tenant', 'owner', 'comments', 'tags',
]


Expand Down Expand Up @@ -307,7 +307,7 @@ class VirtualCircuitTypeForm(OrganizationalModelForm):
class Meta:
model = VirtualCircuitType
fields = [
'name', 'slug', 'color', 'description', 'owner', 'tags',
'name', 'slug', 'color', 'description', 'owner', 'comments', 'tags',
]


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 5.2.8 on 2025-12-08 17:38

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('circuits', '0054_cable_position'),
]

operations = [
migrations.AddField(
model_name='circuitgroup',
name='comments',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='circuittype',
name='comments',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='virtualcircuittype',
name='comments',
field=models.TextField(blank=True),
),
]
3 changes: 3 additions & 0 deletions netbox/circuits/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class CircuitGroupIndex(SearchIndex):
('name', 100),
('slug', 110),
('description', 500),
('comments', 5000),
)
display_attrs = ('description',)

Expand All @@ -44,6 +45,7 @@ class CircuitTypeIndex(SearchIndex):
('name', 100),
('slug', 110),
('description', 500),
('comments', 5000),
)
display_attrs = ('description',)

Expand Down Expand Up @@ -109,5 +111,6 @@ class VirtualCircuitTypeIndex(SearchIndex):
('name', 100),
('slug', 110),
('description', 500),
('comments', 5000),
)
display_attrs = ('description',)
6 changes: 3 additions & 3 deletions netbox/circuits/tables/circuits.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class CircuitTypeTable(OrganizationalModelTable):
class Meta(OrganizationalModelTable.Meta):
model = CircuitType
fields = (
'pk', 'id', 'name', 'circuit_count', 'color', 'description', 'slug', 'tags', 'created', 'last_updated',
'actions',
'pk', 'id', 'name', 'circuit_count', 'color', 'description', 'slug', 'comments', 'tags', 'created',
'last_updated', 'actions',
)
default_columns = ('pk', 'name', 'circuit_count', 'color', 'description')

Expand Down Expand Up @@ -175,7 +175,7 @@ class CircuitGroupTable(OrganizationalModelTable):
class Meta(OrganizationalModelTable.Meta):
model = CircuitGroup
fields = (
'pk', 'name', 'description', 'circuit_group_assignment_count', 'tags',
'pk', 'name', 'description', 'circuit_group_assignment_count', 'comments', 'tags',
'created', 'last_updated', 'actions',
)
default_columns = ('pk', 'name', 'description', 'circuit_group_assignment_count')
Expand Down
4 changes: 2 additions & 2 deletions netbox/dcim/api/serializers_/manufacturers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ManufacturerSerializer(OrganizationalModelSerializer):
class Meta:
model = Manufacturer
fields = [
'id', 'url', 'display_url', 'display', 'name', 'slug', 'description', 'owner', 'tags', 'custom_fields',
'created', 'last_updated', 'devicetype_count', 'inventoryitem_count', 'platform_count',
'id', 'url', 'display_url', 'display', 'name', 'slug', 'description', 'owner', 'comments', 'tags',
'custom_fields', 'created', 'last_updated', 'devicetype_count', 'inventoryitem_count', 'platform_count',
]
brief_fields = ('id', 'url', 'display', 'name', 'slug', 'description', 'devicetype_count')
2 changes: 1 addition & 1 deletion netbox/dcim/api/serializers_/racks.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class RackRoleSerializer(OrganizationalModelSerializer):
class Meta:
model = RackRole
fields = [
'id', 'url', 'display_url', 'display', 'name', 'slug', 'color', 'description', 'owner', 'tags',
'id', 'url', 'display_url', 'display', 'name', 'slug', 'color', 'description', 'owner', 'comments', 'tags',
'custom_fields', 'created', 'last_updated', 'rack_count',
]
brief_fields = ('id', 'url', 'display', 'name', 'slug', 'description', 'rack_count')
Expand Down
2 changes: 1 addition & 1 deletion netbox/dcim/api/serializers_/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class InventoryItemRoleSerializer(OrganizationalModelSerializer):
class Meta:
model = InventoryItemRole
fields = [
'id', 'url', 'display_url', 'display', 'name', 'slug', 'color', 'description', 'owner', 'tags',
'id', 'url', 'display_url', 'display', 'name', 'slug', 'color', 'description', 'owner', 'comments', 'tags',
'custom_fields', 'created', 'last_updated', 'inventoryitem_count',
]
brief_fields = ('id', 'url', 'display', 'name', 'slug', 'description', 'inventoryitem_count')
6 changes: 3 additions & 3 deletions netbox/dcim/forms/bulk_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class RackRoleBulkEditForm(OrganizationalModelBulkEditForm):
fieldsets = (
FieldSet('color', 'description'),
)
nullable_fields = ('color', 'description')
nullable_fields = ('color', 'description', 'comments')


class RackTypeBulkEditForm(PrimaryModelBulkEditForm):
Expand Down Expand Up @@ -474,7 +474,7 @@ class ManufacturerBulkEditForm(OrganizationalModelBulkEditForm):
fieldsets = (
FieldSet('description'),
)
nullable_fields = ('description',)
nullable_fields = ('description', 'comments')


class DeviceTypeBulkEditForm(PrimaryModelBulkEditForm):
Expand Down Expand Up @@ -1719,7 +1719,7 @@ class InventoryItemRoleBulkEditForm(OrganizationalModelBulkEditForm):
fieldsets = (
FieldSet('color', 'description'),
)
nullable_fields = ('color', 'description')
nullable_fields = ('color', 'description', 'comments')


class VirtualDeviceContextBulkEditForm(PrimaryModelBulkEditForm):
Expand Down
6 changes: 3 additions & 3 deletions netbox/dcim/forms/bulk_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class RackRoleImportForm(OrganizationalModelImportForm):

class Meta:
model = RackRole
fields = ('name', 'slug', 'color', 'description', 'owner', 'tags')
fields = ('name', 'slug', 'color', 'description', 'owner', 'comments', 'tags')


class RackTypeImportForm(PrimaryModelImportForm):
Expand Down Expand Up @@ -400,7 +400,7 @@ class ManufacturerImportForm(OrganizationalModelImportForm):

class Meta:
model = Manufacturer
fields = ('name', 'slug', 'description', 'owner', 'tags')
fields = ('name', 'slug', 'description', 'owner', 'comments', 'tags')


class DeviceTypeImportForm(PrimaryModelImportForm):
Expand Down Expand Up @@ -1298,7 +1298,7 @@ class InventoryItemRoleImportForm(OrganizationalModelImportForm):

class Meta:
model = InventoryItemRole
fields = ('name', 'slug', 'color', 'description')
fields = ('name', 'slug', 'color', 'description', 'owner', 'comments')


#
Expand Down
6 changes: 3 additions & 3 deletions netbox/dcim/forms/model_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class RackRoleForm(OrganizationalModelForm):
class Meta:
model = RackRole
fields = [
'name', 'slug', 'color', 'description', 'owner', 'tags',
'name', 'slug', 'color', 'description', 'owner', 'comments', 'tags',
]


Expand Down Expand Up @@ -345,7 +345,7 @@ class ManufacturerForm(OrganizationalModelForm):
class Meta:
model = Manufacturer
fields = [
'name', 'slug', 'description', 'owner', 'tags',
'name', 'slug', 'description', 'owner', 'comments', 'tags',
]


Expand Down Expand Up @@ -1880,7 +1880,7 @@ class InventoryItemRoleForm(OrganizationalModelForm):
class Meta:
model = InventoryItemRole
fields = [
'name', 'slug', 'color', 'description', 'owner', 'tags',
'name', 'slug', 'color', 'description', 'owner', 'comments', 'tags',
]


Expand Down
28 changes: 28 additions & 0 deletions netbox/dcim/migrations/0224_add_comments_to_organizationalmodel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 5.2.8 on 2025-12-08 17:38

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('dcim', '0223_frontport_positions'),
]

operations = [
migrations.AddField(
model_name='inventoryitemrole',
name='comments',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='manufacturer',
name='comments',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='rackrole',
name='comments',
field=models.TextField(blank=True),
),
]
14 changes: 14 additions & 0 deletions netbox/dcim/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,18 @@ class InventoryItemIndex(SearchIndex):
display_attrs = ('device', 'manufacturer', 'parent', 'part_id', 'serial', 'asset_tag', 'description')


@register_search
class InventoryItemRoleIndex(SearchIndex):
model = models.InventoryItemRole
fields = (
('name', 100),
('slug', 110),
('description', 500),
('comments', 5000),
)
display_attrs = ('description',)


@register_search
class LocationIndex(SearchIndex):
model = models.Location
Expand All @@ -157,6 +169,7 @@ class ManufacturerIndex(SearchIndex):
('name', 100),
('slug', 110),
('description', 500),
('comments', 5000),
)
display_attrs = ('description',)

Expand Down Expand Up @@ -308,6 +321,7 @@ class RackRoleIndex(SearchIndex):
('name', 100),
('slug', 110),
('description', 500),
('comments', 5000),
)
display_attrs = ('description',)

Expand Down
2 changes: 1 addition & 1 deletion netbox/dcim/tables/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ class InventoryItemRoleTable(OrganizationalModelTable):
class Meta(OrganizationalModelTable.Meta):
model = models.InventoryItemRole
fields = (
'pk', 'id', 'name', 'inventoryitem_count', 'color', 'description', 'slug', 'tags', 'actions',
'pk', 'id', 'name', 'inventoryitem_count', 'color', 'description', 'slug', 'comments', 'tags', 'actions',
)
default_columns = ('pk', 'name', 'inventoryitem_count', 'color', 'description')

Expand Down
3 changes: 2 additions & 1 deletion netbox/dcim/tables/devicetypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ class Meta(OrganizationalModelTable.Meta):
model = models.Manufacturer
fields = (
'pk', 'id', 'name', 'racktype_count', 'devicetype_count', 'moduletype_count', 'inventoryitem_count',
'platform_count', 'description', 'slug', 'tags', 'contacts', 'actions', 'created', 'last_updated',
'platform_count', 'description', 'slug', 'comments', 'tags', 'contacts', 'actions', 'created',
'last_updated',
)
default_columns = (
'pk', 'name', 'racktype_count', 'devicetype_count', 'moduletype_count', 'inventoryitem_count',
Expand Down
2 changes: 1 addition & 1 deletion netbox/dcim/tables/racks.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class RackRoleTable(OrganizationalModelTable):
class Meta(OrganizationalModelTable.Meta):
model = RackRole
fields = (
'pk', 'id', 'name', 'rack_count', 'color', 'description', 'slug', 'tags', 'actions', 'created',
'pk', 'id', 'name', 'rack_count', 'color', 'description', 'slug', 'comments', 'tags', 'actions', 'created',
'last_updated',
)
default_columns = ('pk', 'name', 'rack_count', 'color', 'description')
Expand Down
3 changes: 2 additions & 1 deletion netbox/dcim/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ class RackRoleView(GetRelatedModelsMixin, generic.ObjectView):
right_panels=[
RelatedObjectsPanel(),
CustomFieldsPanel(),
CommentsPanel(),
],
)

Expand Down Expand Up @@ -1233,7 +1234,7 @@ class ManufacturerView(GetRelatedModelsMixin, generic.ObjectView):
queryset = Manufacturer.objects.all()
layout = layout.SimpleLayout(
left_panels=[OrganizationalObjectPanel(), TagsPanel()],
right_panels=[RelatedObjectsPanel(), CustomFieldsPanel()],
right_panels=[RelatedObjectsPanel(), CustomFieldsPanel(), CommentsPanel()],
)

def get_extra_context(self, request, instance):
Expand Down
Loading
Loading