Add comments to OrganizationalModel

This commit is contained in:
Arthur 2025-12-08 09:46:38 -08:00
parent 3483d979d4
commit e910d461ea
11 changed files with 158 additions and 0 deletions

View File

@ -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),
),
]

View File

@ -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', '0221_cable_position'),
]
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),
),
]

View File

@ -0,0 +1,33 @@
# Generated by Django 5.2.8 on 2025-12-08 17:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ipam', '0084_owner'),
]
operations = [
migrations.AddField(
model_name='asnrange',
name='comments',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='rir',
name='comments',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='role',
name='comments',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='vlangroup',
name='comments',
field=models.TextField(blank=True),
),
]

View File

@ -91,6 +91,7 @@ class OrganizationalModelBulkEditForm(OwnerMixin, NetBoxModelBulkEditForm):
max_length=200,
required=False
)
comments = CommentField()
class NestedGroupModelBulkEditForm(OwnerMixin, NetBoxModelBulkEditForm):

View File

@ -91,6 +91,7 @@ class OrganizationalModelForm(OwnerMixin, NetBoxModelForm):
Form for models which inherit from OrganizationalModel.
"""
slug = SlugField()
comments = CommentField()
class NestedGroupModelForm(OwnerMixin, NetBoxModelForm):

View File

@ -58,6 +58,7 @@ class OrganizationalModelFilterMixin(
name: FilterLookup[str] | None = strawberry_django.filter_field()
slug: FilterLookup[str] | None = strawberry_django.filter_field()
description: FilterLookup[str] | None = strawberry_django.filter_field()
comments: FilterLookup[str] | None = strawberry_django.filter_field()
@dataclass

View File

@ -215,6 +215,10 @@ class OrganizationalModel(OwnerMixin, NetBoxModel):
max_length=200,
blank=True
)
comments = models.TextField(
verbose_name=_('comments'),
blank=True
)
class Meta:
abstract = True

View File

@ -285,6 +285,9 @@ class OrganizationalModelTable(NetBoxTable):
linkify=True,
verbose_name=_('Owner')
)
comments = columns.MarkdownColumn(
verbose_name=_('Comments'),
)
class NestedGroupModelTable(NetBoxTable):

View File

@ -0,0 +1,18 @@
# Generated by Django 5.2.8 on 2025-12-08 17:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tenancy', '0021_owner'),
]
operations = [
migrations.AddField(
model_name='contactrole',
name='comments',
field=models.TextField(blank=True),
),
]

View File

@ -0,0 +1,23 @@
# Generated by Django 5.2.8 on 2025-12-08 17:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('virtualization', '0050_virtualmachine_start_on_boot'),
]
operations = [
migrations.AddField(
model_name='clustergroup',
name='comments',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='clustertype',
name='comments',
field=models.TextField(blank=True),
),
]

View File

@ -0,0 +1,18 @@
# Generated by Django 5.2.8 on 2025-12-08 17:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('vpn', '0010_owner'),
]
operations = [
migrations.AddField(
model_name='tunnelgroup',
name='comments',
field=models.TextField(blank=True),
),
]