[PR #15403] [MERGED] Closes #15383: Standardize filtering logic for the parents of recursively-nested models #14584

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/15403
Author: @jeremystretch
Created: 3/11/2024
Status: Merged
Merged: 3/11/2024
Merged by: @jeremystretch

Base: featureHead: 15383-mptt-filters


📝 Commits (1)

  • e49d301 Closes #15383: Standardize filtering logic for the parents of recursively-nested models

📊 Changes

6 files changed (+262 additions, -90 deletions)

View changed files

📝 netbox/dcim/filtersets.py (+38 -2)
📝 netbox/dcim/tests/test_filtersets.py (+92 -41)
📝 netbox/tenancy/filtersets.py (+28 -2)
📝 netbox/tenancy/tests/test_filtersets.py (+62 -32)
📝 netbox/wireless/filtersets.py (+11 -0)
📝 netbox/wireless/tests/test_filtersets.py (+31 -13)

📄 Description

Fixes: #15383

  • Modify the parent and parent_id filters for Location to return only immediate children
  • Add ancestor and ancestor_id filters for all recursively-nested models to return all children

🔄 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/15403 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 3/11/2024 **Status:** ✅ Merged **Merged:** 3/11/2024 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `15383-mptt-filters` --- ### 📝 Commits (1) - [`e49d301`](https://github.com/netbox-community/netbox/commit/e49d301d81de69036683147f4b47525a9c09ca04) Closes #15383: Standardize filtering logic for the parents of recursively-nested models ### 📊 Changes **6 files changed** (+262 additions, -90 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/filtersets.py` (+38 -2) 📝 `netbox/dcim/tests/test_filtersets.py` (+92 -41) 📝 `netbox/tenancy/filtersets.py` (+28 -2) 📝 `netbox/tenancy/tests/test_filtersets.py` (+62 -32) 📝 `netbox/wireless/filtersets.py` (+11 -0) 📝 `netbox/wireless/tests/test_filtersets.py` (+31 -13) </details> ### 📄 Description ### Fixes: #15383 - Modify the `parent` and `parent_id` filters for Location to return only immediate children - Add `ancestor` and `ancestor_id` filters for all recursively-nested models to return _all_ children --- <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 23:25:20 +01:00
adam closed this issue 2025-12-29 23:25:20 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14584