[PR #7826] [MERGED] Add filter for optionally including assigned prefixes #13290

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/7826
Author: @WillIrvine
Created: 11/13/2021
Status: Merged
Merged: 12/13/2021
Merged by: @jeremystretch

Base: developHead: develop


📝 Commits (7)

  • 0edf9b1 Closes #7665 add new boolen for filtering assigned prefixes, adjust current filter for avaliabile prefixes to only return avaliable
  • 641a9bc pep8 compliance
  • 80048bf Make the same changes for aggregate views as these use the same adjusted functions
  • dcfd332 Moved filtering logic to utils, adjusted show buttons
  • ca07a88 fix spelling...
  • aebfccf Merge branch 'develop' into develop
  • 13414dc pep8 compliance...

📊 Changes

3 files changed (+37 additions, -24 deletions)

View changed files

📝 netbox/ipam/utils.py (+19 -9)
📝 netbox/ipam/views.py (+11 -11)
📝 netbox/templates/ipam/inc/toggle_available.html (+7 -4)

📄 Description

Fixes: #7665

  • Added new filtering boolean "show_assigned" for optionally including assigned prefixes in filtered table, note: this defaults to true so the previous functionality is maintained. you just now have the option of using false and filtering these out
  • Adjusted "add_available_prefixes" function to only return available prefixes, rather than adding to prefix_list, addition is now done in the view
  • Moved sorting logic to the view so that we only sort once after adding all requested prefixes to the list.

Adding a second boolean seems like a much better option than trying to add a third option to the current boolean (as was proposed in the original issue).


🔄 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/7826 **Author:** [@WillIrvine](https://github.com/WillIrvine) **Created:** 11/13/2021 **Status:** ✅ Merged **Merged:** 12/13/2021 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `develop` --- ### 📝 Commits (7) - [`0edf9b1`](https://github.com/netbox-community/netbox/commit/0edf9b17f65636aa36275c8b35f68553226f3989) Closes #7665 add new boolen for filtering assigned prefixes, adjust current filter for avaliabile prefixes to only return avaliable - [`641a9bc`](https://github.com/netbox-community/netbox/commit/641a9bc6c56a214737b673add3f3de9efb9b9671) pep8 compliance - [`80048bf`](https://github.com/netbox-community/netbox/commit/80048bfa2b259b1f3dad5bf7ddefc7c1254ccd6a) Make the same changes for aggregate views as these use the same adjusted functions - [`dcfd332`](https://github.com/netbox-community/netbox/commit/dcfd332cbfb2817b91ec744933291a718b3ebbdd) Moved filtering logic to utils, adjusted show buttons - [`ca07a88`](https://github.com/netbox-community/netbox/commit/ca07a886747f59f17b1034af3fa14acb14fa3065) fix spelling... - [`aebfccf`](https://github.com/netbox-community/netbox/commit/aebfccfd4be16d11de236ec7e7854105ec6a39b6) Merge branch 'develop' into develop - [`13414dc`](https://github.com/netbox-community/netbox/commit/13414dcd25e2587bcf3c0f4fcc081dca176385d4) pep8 compliance... ### 📊 Changes **3 files changed** (+37 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `netbox/ipam/utils.py` (+19 -9) 📝 `netbox/ipam/views.py` (+11 -11) 📝 `netbox/templates/ipam/inc/toggle_available.html` (+7 -4) </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 opened for approval prior to filing a pull request. This helps avoid wasting time and effort on something that we might not be able to accept. Please indicate the relevant feature request or bug report below. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ACCEPTED BUG REPORT OR FEATURE REQUEST, IT WILL BE MARKED AS INVALID AND CLOSED. --> ### Fixes: #7665 <!-- --> - Added new filtering boolean "show_assigned" for optionally including assigned prefixes in filtered table, note: this defaults to true so the previous functionality is maintained. you just now have the option of using false and filtering these out - Adjusted "add_available_prefixes" function to only return available prefixes, rather than adding to prefix_list, addition is now done in the view - Moved sorting logic to the view so that we only sort once after adding all requested prefixes to the list. Adding a second boolean seems like a much better option than trying to add a third option to the current boolean (as was proposed in the original issue). --- <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:26:34 +01:00
adam closed this issue 2025-12-29 22:26:34 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13290