[PR #20486] [CLOSED] Add a GenericRelation "mac_addresses" to BaseInterface #15942

Closed
opened 2025-12-30 00:24:55 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20486
Author: @bctiemann
Created: 10/3/2025
Status: Closed

Base: mainHead: 19720-macaddress-interface-generic-relation


📝 Commits (1)

  • 15f695b Add a GenericRelation to BaseInterface allowing MACAddress objects to be queried via "interface" reverse relation in permissions

📊 Changes

1 file changed (+6 additions, -0 deletions)

View changed files

📝 netbox/dcim/models/device_components.py (+6 -0)

📄 Description

Fixes: #19720

Adds a GenericRelation to BaseInterface providing a reverse lookup interface which can be used in MACAddress queries against the assigned_object field (a GFK to Interface or VMInterface), for example in permissions:

Screenshot 2025-10-02 at 10 04 44 PM

Note that this lookup will be called interface regardless of whether the target object is an Interface or a VMInterface.


🔄 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/20486 **Author:** [@bctiemann](https://github.com/bctiemann) **Created:** 10/3/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `19720-macaddress-interface-generic-relation` --- ### 📝 Commits (1) - [`15f695b`](https://github.com/netbox-community/netbox/commit/15f695b35a71647f1cce3b3074a6481ac2c8e0bf) Add a GenericRelation to BaseInterface allowing MACAddress objects to be queried via "interface" reverse relation in permissions ### 📊 Changes **1 file changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/models/device_components.py` (+6 -0) </details> ### 📄 Description ### Fixes: #19720 Adds a `GenericRelation` to `BaseInterface` providing a reverse lookup `interface` which can be used in `MACAddress` queries against the `assigned_object` field (a GFK to `Interface` or `VMInterface`), for example in permissions: <img width="793" height="669" alt="Screenshot 2025-10-02 at 10 04 44 PM" src="https://github.com/user-attachments/assets/9230b102-d7ba-4c34-ab0a-93e09f338039" /> Note that this lookup will be called `interface` regardless of whether the target object is an `Interface` or a `VMInterface`. --- <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-30 00:24:55 +01:00
adam closed this issue 2025-12-30 00:24:55 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15942