[PR #20047] [MERGED] Closes #19740: Enable recursive nesting for platforms #15809

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20047
Author: @jeremystretch
Created: 8/7/2025
Status: Merged
Merged: 8/12/2025
Merged by: @bctiemann

Base: featureHead: 19740-platform-nesting


📝 Commits (1)

📊 Changes

22 files changed (+286 additions, -41 deletions)

View changed files

📝 docs/models/dcim/platform.md (+9 -1)
📝 netbox/dcim/api/serializers_/nested.py (+9 -0)
📝 netbox/dcim/api/serializers_/platforms.py (+10 -5)
📝 netbox/dcim/filtersets.py (+35 -6)
📝 netbox/dcim/forms/bulk_edit.py (+8 -2)
📝 netbox/dcim/forms/bulk_import.py (+11 -1)
📝 netbox/dcim/forms/filtersets.py (+5 -0)
📝 netbox/dcim/forms/model_forms.py (+10 -2)
📝 netbox/dcim/graphql/types.py (+2 -0)
netbox/dcim/migrations/0211_platform_parent.py (+55 -0)
netbox/dcim/migrations/0212_platform_rebuild.py (+29 -0)
📝 netbox/dcim/models/devices.py (+3 -1)
📝 netbox/dcim/tables/devices.py (+1 -1)
📝 netbox/dcim/tests/test_api.py (+5 -2)
📝 netbox/dcim/tests/test_filtersets.py (+53 -7)
📝 netbox/dcim/tests/test_views.py (+9 -6)
📝 netbox/extras/tests/test_filtersets.py (+2 -1)
📝 netbox/templates/dcim/platform.html (+18 -0)
📝 netbox/utilities/tests/test_filters.py (+2 -1)
📝 netbox/virtualization/filtersets.py (+6 -3)

...and 2 more files

📄 Description

Closes: #19740

  • Convert the Platform model to a NestedGroupModel (add a parent recursive ForeignKey)
  • Convert PlatformSerializer to a NestedGroupModelSerializer
  • Add NestedPlatformSerializer for nested platforms
  • Add parent & ancestor filters to PlatformFilterSet
  • Update tests & documentation

🔄 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/20047 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 8/7/2025 **Status:** ✅ Merged **Merged:** 8/12/2025 **Merged by:** [@bctiemann](https://github.com/bctiemann) **Base:** `feature` ← **Head:** `19740-platform-nesting` --- ### 📝 Commits (1) - [`148fac1`](https://github.com/netbox-community/netbox/commit/148fac10866d27d226e2411ffea58fc8b960effa) Closes #19740: Enable recursive nesting for platforms ### 📊 Changes **22 files changed** (+286 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `docs/models/dcim/platform.md` (+9 -1) 📝 `netbox/dcim/api/serializers_/nested.py` (+9 -0) 📝 `netbox/dcim/api/serializers_/platforms.py` (+10 -5) 📝 `netbox/dcim/filtersets.py` (+35 -6) 📝 `netbox/dcim/forms/bulk_edit.py` (+8 -2) 📝 `netbox/dcim/forms/bulk_import.py` (+11 -1) 📝 `netbox/dcim/forms/filtersets.py` (+5 -0) 📝 `netbox/dcim/forms/model_forms.py` (+10 -2) 📝 `netbox/dcim/graphql/types.py` (+2 -0) ➕ `netbox/dcim/migrations/0211_platform_parent.py` (+55 -0) ➕ `netbox/dcim/migrations/0212_platform_rebuild.py` (+29 -0) 📝 `netbox/dcim/models/devices.py` (+3 -1) 📝 `netbox/dcim/tables/devices.py` (+1 -1) 📝 `netbox/dcim/tests/test_api.py` (+5 -2) 📝 `netbox/dcim/tests/test_filtersets.py` (+53 -7) 📝 `netbox/dcim/tests/test_views.py` (+9 -6) 📝 `netbox/extras/tests/test_filtersets.py` (+2 -1) 📝 `netbox/templates/dcim/platform.html` (+18 -0) 📝 `netbox/utilities/tests/test_filters.py` (+2 -1) 📝 `netbox/virtualization/filtersets.py` (+6 -3) _...and 2 more files_ </details> ### 📄 Description ### Closes: #19740 - Convert the Platform model to a NestedGroupModel (add a `parent` recursive ForeignKey) - Convert PlatformSerializer to a NestedGroupModelSerializer - Add NestedPlatformSerializer for nested platforms - Add `parent` & `ancestor` filters to PlatformFilterSet - Update tests & documentation --- <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:24:11 +01:00
adam closed this issue 2025-12-30 00:24:11 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15809