[PR #5930] [MERGED] Closes #1519: Enable parent assignment for interfaces #13071

Closed
opened 2025-12-29 22:25:15 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/5930
Author: @jeremystretch
Created: 3/5/2021
Status: Merged
Merged: 3/5/2021
Merged by: @jeremystretch

Base: featureHead: 1519-interface-parent


📝 Commits (6)

📊 Changes

23 files changed (+223 additions, -88 deletions)

View changed files

📝 docs/release-notes/version-2.11.md (+6 -0)
📝 netbox/circuits/models.py (+1 -1)
📝 netbox/dcim/api/serializers.py (+6 -4)
📝 netbox/dcim/api/views.py (+1 -1)
📝 netbox/dcim/filters.py (+5 -0)
📝 netbox/dcim/forms.py (+74 -36)
netbox/dcim/migrations/0129_interface_parent.py (+17 -0)
📝 netbox/dcim/models/device_component_templates.py (+0 -2)
📝 netbox/dcim/models/device_components.py (+47 -18)
📝 netbox/dcim/models/power.py (+1 -1)
📝 netbox/dcim/models/sites.py (+1 -3)
📝 netbox/dcim/tables/devices.py (+9 -5)
📝 netbox/dcim/tables/template_code.py (+2 -2)
📝 netbox/dcim/tests/test_filters.py (+28 -0)
📝 netbox/dcim/views.py (+2 -2)
📝 netbox/ipam/models/ip.py (+1 -2)
📝 netbox/templates/dcim/cable_trace.html (+2 -2)
📝 netbox/templates/dcim/inc/cabletermination.html (+5 -5)
📝 netbox/templates/dcim/inc/endpoint_connection.html (+1 -1)
📝 netbox/templates/dcim/interface.html (+11 -1)

...and 3 more files

📄 Description

Fixes: #1519

  • Add a parent ForeignKey on the Interface model pointing to itself
  • Add a parent_id filter and test (also adds a missing test for lag_id)

🔄 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/5930 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 3/5/2021 **Status:** ✅ Merged **Merged:** 3/5/2021 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `1519-interface-parent` --- ### 📝 Commits (6) - [`7a5cf80`](https://github.com/netbox-community/netbox/commit/7a5cf8041279dab266122f82244441a6482bead6) Clean up extraneous imports - [`8e1fe63`](https://github.com/netbox-community/netbox/commit/8e1fe6339e46e671c4ba6f3f49256d3d77ebb5c4) Rename parent attribute on CableTerminations to parent_object - [`e1a8613`](https://github.com/netbox-community/netbox/commit/e1a86139dc8b4f092bbdb03b1f5b371b911e87e0) Add parent field to Interface - [`d74c07e`](https://github.com/netbox-community/netbox/commit/d74c07e1a25b2e6aa440defcf2c4a71cbe32d10c) Clean up parent/LAG interface form validation - [`69a3d14`](https://github.com/netbox-community/netbox/commit/69a3d14b5370e1161dae3a103adf77e2ecf965c0) Add filter tests for interface parent and LAG - [`2ef85ea`](https://github.com/netbox-community/netbox/commit/2ef85ea195166b3092b9b859c5f5e7ae89183ed6) Changelog for #1519 ### 📊 Changes **23 files changed** (+223 additions, -88 deletions) <details> <summary>View changed files</summary> 📝 `docs/release-notes/version-2.11.md` (+6 -0) 📝 `netbox/circuits/models.py` (+1 -1) 📝 `netbox/dcim/api/serializers.py` (+6 -4) 📝 `netbox/dcim/api/views.py` (+1 -1) 📝 `netbox/dcim/filters.py` (+5 -0) 📝 `netbox/dcim/forms.py` (+74 -36) ➕ `netbox/dcim/migrations/0129_interface_parent.py` (+17 -0) 📝 `netbox/dcim/models/device_component_templates.py` (+0 -2) 📝 `netbox/dcim/models/device_components.py` (+47 -18) 📝 `netbox/dcim/models/power.py` (+1 -1) 📝 `netbox/dcim/models/sites.py` (+1 -3) 📝 `netbox/dcim/tables/devices.py` (+9 -5) 📝 `netbox/dcim/tables/template_code.py` (+2 -2) 📝 `netbox/dcim/tests/test_filters.py` (+28 -0) 📝 `netbox/dcim/views.py` (+2 -2) 📝 `netbox/ipam/models/ip.py` (+1 -2) 📝 `netbox/templates/dcim/cable_trace.html` (+2 -2) 📝 `netbox/templates/dcim/inc/cabletermination.html` (+5 -5) 📝 `netbox/templates/dcim/inc/endpoint_connection.html` (+1 -1) 📝 `netbox/templates/dcim/interface.html` (+11 -1) _...and 3 more files_ </details> ### 📄 Description ### Fixes: #1519 - Add a `parent` ForeignKey on the Interface model pointing to itself - Add a `parent_id` filter and test (also adds a missing test for `lag_id`) --- <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-29 22:25:15 +01:00
adam closed this issue 2025-12-29 22:25:15 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13071