1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Introduce ContactsMixin

This commit is contained in:
Jeremy Stretch
2023-08-04 09:43:44 -04:00
parent 14e23c3d00
commit 2afce6c94b
11 changed files with 40 additions and 94 deletions

View File

@@ -1,10 +1,10 @@
from django.contrib.contenttypes.fields import GenericRelation
from django.db import models
from django.db.models import Q
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from netbox.models import NestedGroupModel, PrimaryModel
from netbox.models.features import ContactsMixin
__all__ = (
'Tenant',
@@ -36,7 +36,7 @@ class TenantGroup(NestedGroupModel):
return reverse('tenancy:tenantgroup', args=[self.pk])
class Tenant(PrimaryModel):
class Tenant(ContactsMixin, PrimaryModel):
"""
A Tenant represents an organization served by the NetBox owner. This is typically a customer or an internal
department.
@@ -57,11 +57,6 @@ class Tenant(PrimaryModel):
null=True
)
# Generic relations
contacts = GenericRelation(
to='tenancy.ContactAssignment'
)
clone_fields = (
'group', 'description',
)