From ae7a47ca60a275ff8574da2f2b50cc055c1091e9 Mon Sep 17 00:00:00 2001 From: Jason Novinger Date: Mon, 10 Mar 2025 11:52:13 -0500 Subject: [PATCH] Adds comments field to abstract NestedGroupModel and associated migrations Models affected: - dcim: `Location`, `Region`, `SiteGroup` - tenancy`: `ContactGroup`, `TenantGroup` - wireless: `WirelessLANGroup` --- ...ents_region_comments_sitegroup_comments.py | 28 +++++++++++++++++++ netbox/netbox/models/__init__.py | 4 +++ ...tactgroup_comments_tenantgroup_comments.py | 23 +++++++++++++++ .../0014_wirelesslangroup_comments.py | 18 ++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 netbox/dcim/migrations/0202_location_comments_region_comments_sitegroup_comments.py create mode 100644 netbox/tenancy/migrations/0018_contactgroup_comments_tenantgroup_comments.py create mode 100644 netbox/wireless/migrations/0014_wirelesslangroup_comments.py diff --git a/netbox/dcim/migrations/0202_location_comments_region_comments_sitegroup_comments.py b/netbox/dcim/migrations/0202_location_comments_region_comments_sitegroup_comments.py new file mode 100644 index 000000000..51031de53 --- /dev/null +++ b/netbox/dcim/migrations/0202_location_comments_region_comments_sitegroup_comments.py @@ -0,0 +1,28 @@ +# Generated by Django 5.1.7 on 2025-03-10 16:37 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('dcim', '0201_add_power_outlet_status'), + ] + + operations = [ + migrations.AddField( + model_name='location', + name='comments', + field=models.TextField(blank=True), + ), + migrations.AddField( + model_name='region', + name='comments', + field=models.TextField(blank=True), + ), + migrations.AddField( + model_name='sitegroup', + name='comments', + field=models.TextField(blank=True), + ), + ] diff --git a/netbox/netbox/models/__init__.py b/netbox/netbox/models/__init__.py index b1f7cfd48..3ad0ac556 100644 --- a/netbox/netbox/models/__init__.py +++ b/netbox/netbox/models/__init__.py @@ -150,6 +150,10 @@ class NestedGroupModel(NetBoxFeatureSet, MPTTModel): max_length=200, blank=True ) + comments = models.TextField( + verbose_name=_('comments'), + blank=True + ) objects = TreeManager() diff --git a/netbox/tenancy/migrations/0018_contactgroup_comments_tenantgroup_comments.py b/netbox/tenancy/migrations/0018_contactgroup_comments_tenantgroup_comments.py new file mode 100644 index 000000000..3481baeec --- /dev/null +++ b/netbox/tenancy/migrations/0018_contactgroup_comments_tenantgroup_comments.py @@ -0,0 +1,23 @@ +# Generated by Django 5.1.7 on 2025-03-10 16:37 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('tenancy', '0017_natural_ordering'), + ] + + operations = [ + migrations.AddField( + model_name='contactgroup', + name='comments', + field=models.TextField(blank=True), + ), + migrations.AddField( + model_name='tenantgroup', + name='comments', + field=models.TextField(blank=True), + ), + ] diff --git a/netbox/wireless/migrations/0014_wirelesslangroup_comments.py b/netbox/wireless/migrations/0014_wirelesslangroup_comments.py new file mode 100644 index 000000000..3e3cab270 --- /dev/null +++ b/netbox/wireless/migrations/0014_wirelesslangroup_comments.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.7 on 2025-03-10 16:37 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('wireless', '0013_natural_ordering'), + ] + + operations = [ + migrations.AddField( + model_name='wirelesslangroup', + name='comments', + field=models.TextField(blank=True), + ), + ]