mirror of
https://github.com/netbox-community/netbox.git
synced 2026-03-21 20:18:38 -06:00
Add a GenericRelation to BaseInterface allowing MACAddress objects to be queried via "interface" reverse relation in permissions
This commit is contained in:
@@ -618,6 +618,12 @@ class BaseInterface(models.Model):
|
||||
null=True,
|
||||
verbose_name=_('primary MAC address')
|
||||
)
|
||||
mac_addresses = GenericRelation(
|
||||
to='dcim.MACAddress',
|
||||
content_type_field='assigned_object_type',
|
||||
object_id_field='assigned_object_id',
|
||||
related_query_name='interface',
|
||||
)
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
Reference in New Issue
Block a user