[PR #9281] [MERGED] Fixes #9280 - Add option to adopt existing DeviceComponents #13449

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/9281
Author: @kkthxbye-code
Created: 5/2/2022
Status: Merged
Merged: 5/5/2022
Merged by: @jeremystretch

Base: developHead: adopt-module-component


📝 Commits (9)

  • 3fb967b Add ability to adopt components when adding a module
  • c2a6a1c Create module components in bulk
  • 977ccb0 Formatting: Remove whitespace on blank line
  • 8040804 Allow mixture of component replication and adoption
  • f455f91 Add view test for module component adoption
  • 7de27c6 Fix PEP8
  • 81c7fe2 Don't adopt components already belonging to a module
  • c52aa21 Prefetch installed components when adding modules
  • 9c3dfdf Fix test_module_component_adoption

📊 Changes

3 files changed (+97 additions, -26 deletions)

View changed files

📝 netbox/dcim/forms/models.py (+13 -2)
📝 netbox/dcim/models/devices.py (+46 -24)
📝 netbox/dcim/tests/test_views.py (+38 -0)

📄 Description

Fixes: #9280

This PR adds a new boolean field (adopt_components) to the Module form. The creation logic has been changed to check for and change the module field on any existing components.

This is still a draft. I need to verify that the API works, and I haven't checked a few cases. Looking for input for the implementation also.


🔄 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/9281 **Author:** [@kkthxbye-code](https://github.com/kkthxbye-code) **Created:** 5/2/2022 **Status:** ✅ Merged **Merged:** 5/5/2022 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `adopt-module-component` --- ### 📝 Commits (9) - [`3fb967b`](https://github.com/netbox-community/netbox/commit/3fb967b482a8239da8b8932f7795bd7f49adc47b) Add ability to adopt components when adding a module - [`c2a6a1c`](https://github.com/netbox-community/netbox/commit/c2a6a1c125fd4c2a286552c08529ebddf0bfc57c) Create module components in bulk - [`977ccb0`](https://github.com/netbox-community/netbox/commit/977ccb01f2f5d6407f0edfd29a4b64f7bd70b086) Formatting: Remove whitespace on blank line - [`8040804`](https://github.com/netbox-community/netbox/commit/8040804c753d070b386b41b650ec53bc10d08e26) Allow mixture of component replication and adoption - [`f455f91`](https://github.com/netbox-community/netbox/commit/f455f91ea3eeb38b1480ef30e6521157b783c782) Add view test for module component adoption - [`7de27c6`](https://github.com/netbox-community/netbox/commit/7de27c69c054f382bf1baa68be9558476bab53fd) Fix PEP8 - [`81c7fe2`](https://github.com/netbox-community/netbox/commit/81c7fe2084b59dcfc16c821f661119bd95adf6f0) Don't adopt components already belonging to a module - [`c52aa21`](https://github.com/netbox-community/netbox/commit/c52aa2196df72f30553c1610905dd3a5b0745982) Prefetch installed components when adding modules - [`9c3dfdf`](https://github.com/netbox-community/netbox/commit/9c3dfdfd14fe4321bbcdc1b642ea79fd2e176a60) Fix test_module_component_adoption ### 📊 Changes **3 files changed** (+97 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/forms/models.py` (+13 -2) 📝 `netbox/dcim/models/devices.py` (+46 -24) 📝 `netbox/dcim/tests/test_views.py` (+38 -0) </details> ### 📄 Description ### Fixes: #9280 This PR adds a new boolean field (adopt_components) to the Module form. The creation logic has been changed to check for and change the module field on any existing components. ~~This is still a draft. I need to verify that the API works, and I haven't checked a few cases.~~ Looking for input for the implementation also. --- <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:27:28 +01:00
adam closed this issue 2025-12-29 22:27:28 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13449