[PR #10291] [MERGED] #8580 add interface filters for connected #13602

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/10291
Author: @arthanson
Created: 9/8/2022
Status: Merged
Merged: 9/12/2022
Merged by: @jeremystretch

Base: developHead: 8580-filter-connected


📝 Commits (7)

📊 Changes

4 files changed (+147 additions, -55 deletions)

View changed files

📝 netbox/circuits/tests/test_filtersets.py (+12 -2)
📝 netbox/dcim/filtersets.py (+9 -0)
📝 netbox/dcim/forms/filtersets.py (+38 -7)
📝 netbox/dcim/tests/test_filtersets.py (+88 -46)

📄 Description

Fixes: #8580

Adds filters to interface for:

cabled - Boolean filter returning only models which have a cable assigned
connected - Boolean filter for path endpoints which returns only models with a complete end-to-end path assigned
is_occupied - Boolean filter for objects which are cabled or which have mark_connected set to True

Added them as a new group to the filters page "Connection" at the end (see screenshot):

Monosnap Interfaces | NetBox 2022-09-07 15-44-18

@jeremystretch I didn't see any place in the docs that need to be updated for a new filter. Do the API specs / GraphQL stuff need to be separately updated if adding a new filter?


🔄 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/10291 **Author:** [@arthanson](https://github.com/arthanson) **Created:** 9/8/2022 **Status:** ✅ Merged **Merged:** 9/12/2022 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `8580-filter-connected` --- ### 📝 Commits (7) - [`b4877e7`](https://github.com/netbox-community/netbox/commit/b4877e7fac49282a766ebcdd2f886f71e8d61fa5) #8580 add interface filters for connected - [`d51e833`](https://github.com/netbox-community/netbox/commit/d51e833bf378912c67f60d6eab6f6ba9565a6f09) #8580 changes from code review - [`0e6a6b7`](https://github.com/netbox-community/netbox/commit/0e6a6b784d3f4461aa7f2b15dec1f44199f10658) Merge branch 'develop' into 8580-filter-connected - [`1daa2ff`](https://github.com/netbox-community/netbox/commit/1daa2ff98d07020c864c90b5f0e306956da35479) #8580 add tests - [`d24f10c`](https://github.com/netbox-community/netbox/commit/d24f10ce6e2878a8963412ec271f0dd449862bf7) #8580 add tests - [`57365ef`](https://github.com/netbox-community/netbox/commit/57365ef7b9d012b4c5d27361bfe7c0ca3012db15) Rename is_occupied to occupied - [`f10460d`](https://github.com/netbox-community/netbox/commit/f10460d774db773c759faa4b9b96c59470c12a5a) Add relevant tests for all device components ### 📊 Changes **4 files changed** (+147 additions, -55 deletions) <details> <summary>View changed files</summary> 📝 `netbox/circuits/tests/test_filtersets.py` (+12 -2) 📝 `netbox/dcim/filtersets.py` (+9 -0) 📝 `netbox/dcim/forms/filtersets.py` (+38 -7) 📝 `netbox/dcim/tests/test_filtersets.py` (+88 -46) </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 approved and assigned prior to filing a pull request. This helps avoid wasting time and effort on something that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WE BE CLOSED AUTOMATICALLY. Specify your assigned issue number on the line below. --> ### Fixes: #8580 <!-- Please include a summary of the proposed changes below. --> Adds filters to interface for: **cabled** - Boolean filter returning only models which have a cable assigned **connected** - Boolean filter for path endpoints which returns only models with a complete end-to-end path assigned **is_occupied** - Boolean filter for objects which are cabled or which have mark_connected set to True Added them as a new group to the filters page "Connection" at the end (see screenshot): ![Monosnap Interfaces | NetBox 2022-09-07 15-44-18](https://user-images.githubusercontent.com/99642/188996547-fdff0e70-cf87-4a4d-8487-c0f2522e5f41.png) @jeremystretch I didn't see any place in the docs that need to be updated for a new filter. Do the API specs / GraphQL stuff need to be separately updated if adding a new filter? --- <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:19:48 +01:00
adam closed this issue 2025-12-29 23:19:49 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13602