mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-17 17:56:29 +00:00
Add a GenericRelation to BaseInterface allowing MACAddress objects to be queried via "interface" reverse relation in permissions
This commit is contained in:
parent
5f77d684e1
commit
15f695b35a
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user