[PR #18859] [MERGED] Closes #17602: adds comments field to NestedGroupModel children #15458

Closed
opened 2025-12-30 00:22:02 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/18859
Author: @jnovinger
Created: 3/10/2025
Status: Merged
Merged: 3/19/2025
Merged by: @bctiemann

Base: featureHead: 17602-comments-field-for-nested-models


📝 Commits (10+)

  • ae7a47c Adds comments field to abstract NestedGroupModel and associated migrations
  • 44efd5e Adds Location.comments field in the required locations
  • 2e2c815 Update Location detail UI template
  • 9a9d6cd Adds Region.comments field in the required locations
  • ed98756 Adds SiteGroup.comments in the required locations
  • b835226 Adds ContactGroup.comments in the required locations
  • 157df20 Adds TenantGroup.comments to the required locations
  • c0b019b Adds WirelessLANGroup.comments to all the required places
  • 1ea6f6e Ensures that all new comments fields render Markdown in tables
  • 2df68e2 Ensures overridden filterset search() methods include fields from OrganizationalModelFilterSet

📊 Changes

42 files changed (+364 additions, -117 deletions)

View changed files

📝 netbox/dcim/api/serializers_/sites.py (+3 -3)
📝 netbox/dcim/filtersets.py (+12 -11)
📝 netbox/dcim/forms/bulk_edit.py (+6 -3)
📝 netbox/dcim/forms/bulk_import.py (+6 -3)
📝 netbox/dcim/forms/model_forms.py (+7 -3)
netbox/dcim/migrations/0202_location_comments_region_comments_sitegroup_comments.py (+26 -0)
📝 netbox/dcim/search.py (+3 -0)
📝 netbox/dcim/tables/sites.py (+14 -5)
📝 netbox/dcim/tests/test_api.py (+14 -3)
📝 netbox/dcim/tests/test_filtersets.py (+39 -5)
📝 netbox/dcim/tests/test_views.py (+34 -23)
📝 netbox/netbox/filtersets.py (+16 -0)
📝 netbox/netbox/models/__init__.py (+4 -0)
📝 netbox/templates/dcim/location.html (+1 -0)
📝 netbox/templates/dcim/region.html (+1 -0)
📝 netbox/templates/dcim/sitegroup.html (+1 -0)
📝 netbox/templates/tenancy/contactgroup.html (+1 -0)
📝 netbox/templates/tenancy/tenantgroup.html (+1 -0)
📝 netbox/templates/wireless/wirelesslangroup.html (+1 -0)
📝 netbox/tenancy/api/serializers_/contacts.py (+1 -1)

...and 22 more files

📄 Description

Fixes: #17602

  • Adds comments field to the following models, via their inheritance of netbox.models.NestedGroupModel:
    • dcim.Location
    • dcim.Region
    • dcim.SiteGroup
    • tenancy.ContactGroup
    • tenancy.TenantGroup
    • wireless.WirelessLANGroup
  • Hooks up the new comments field to all the required places

Review Notes

I tried to keep changes for each model to its own commit, to make review easier. However, there were a couple of commits that address things I missed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/18859 **Author:** [@jnovinger](https://github.com/jnovinger) **Created:** 3/10/2025 **Status:** ✅ Merged **Merged:** 3/19/2025 **Merged by:** [@bctiemann](https://github.com/bctiemann) **Base:** `feature` ← **Head:** `17602-comments-field-for-nested-models` --- ### 📝 Commits (10+) - [`ae7a47c`](https://github.com/netbox-community/netbox/commit/ae7a47ca60a275ff8574da2f2b50cc055c1091e9) Adds comments field to abstract NestedGroupModel and associated migrations - [`44efd5e`](https://github.com/netbox-community/netbox/commit/44efd5e833212e3e12c3f7ab75fc2d1cf3a4b314) Adds Location.comments field in the required locations - [`2e2c815`](https://github.com/netbox-community/netbox/commit/2e2c815c9140528f0ae537b8327921e9c5d9ffe2) Update Location detail UI template - [`9a9d6cd`](https://github.com/netbox-community/netbox/commit/9a9d6cdedb6f06687b7c7a350b9ae7fcfd6a4e37) Adds Region.comments field in the required locations - [`ed98756`](https://github.com/netbox-community/netbox/commit/ed98756f3eb329a2343a91eb8853b9e186ec0c8a) Adds SiteGroup.comments in the required locations - [`b835226`](https://github.com/netbox-community/netbox/commit/b8352260ee7dcf8be80281d7f45b5dc87096d3ca) Adds ContactGroup.comments in the required locations - [`157df20`](https://github.com/netbox-community/netbox/commit/157df20ad4354428d81da32ab8a36321b5e0318a) Adds TenantGroup.comments to the required locations - [`c0b019b`](https://github.com/netbox-community/netbox/commit/c0b019b735b612d3b2c9c123eb35cdb6a724ffa3) Adds WirelessLANGroup.comments to all the required places - [`1ea6f6e`](https://github.com/netbox-community/netbox/commit/1ea6f6e2ce14407226596cb2b596578314f143eb) Ensures that all new comments fields render Markdown in tables - [`2df68e2`](https://github.com/netbox-community/netbox/commit/2df68e29c9b9944a8ed48ae04671d9391081a3c2) Ensures overridden filterset search() methods include fields from OrganizationalModelFilterSet ### 📊 Changes **42 files changed** (+364 additions, -117 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/api/serializers_/sites.py` (+3 -3) 📝 `netbox/dcim/filtersets.py` (+12 -11) 📝 `netbox/dcim/forms/bulk_edit.py` (+6 -3) 📝 `netbox/dcim/forms/bulk_import.py` (+6 -3) 📝 `netbox/dcim/forms/model_forms.py` (+7 -3) ➕ `netbox/dcim/migrations/0202_location_comments_region_comments_sitegroup_comments.py` (+26 -0) 📝 `netbox/dcim/search.py` (+3 -0) 📝 `netbox/dcim/tables/sites.py` (+14 -5) 📝 `netbox/dcim/tests/test_api.py` (+14 -3) 📝 `netbox/dcim/tests/test_filtersets.py` (+39 -5) 📝 `netbox/dcim/tests/test_views.py` (+34 -23) 📝 `netbox/netbox/filtersets.py` (+16 -0) 📝 `netbox/netbox/models/__init__.py` (+4 -0) 📝 `netbox/templates/dcim/location.html` (+1 -0) 📝 `netbox/templates/dcim/region.html` (+1 -0) 📝 `netbox/templates/dcim/sitegroup.html` (+1 -0) 📝 `netbox/templates/tenancy/contactgroup.html` (+1 -0) 📝 `netbox/templates/tenancy/tenantgroup.html` (+1 -0) 📝 `netbox/templates/wireless/wirelesslangroup.html` (+1 -0) 📝 `netbox/tenancy/api/serializers_/contacts.py` (+1 -1) _...and 22 more files_ </details> ### 📄 Description <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be approved and assigned prior to opening a pull request. This helps avoid waste time and effort on a proposed change that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WILL BE CLOSED AUTOMATICALLY. Please specify your assigned issue number on the line below. --> ### Fixes: #17602 - Adds `comments` field to the following models, via their inheritance of `netbox.models.NestedGroupModel`: - [x] `dcim.Location` - [x] `dcim.Region` - [x] `dcim.SiteGroup` - [x] `tenancy.ContactGroup` - [x] `tenancy.TenantGroup` - [x] `wireless.WirelessLANGroup` - Hooks up the new `comments` field to all the required places #### Review Notes I tried to keep changes for each model to its own commit, to make review easier. However, there were a couple of commits that address things I missed. <!-- Please include a summary of the proposed changes below. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:22:02 +01:00
adam closed this issue 2025-12-30 00:22:03 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15458