Merge main into feature

This commit is contained in:
Jeremy Stretch
2025-04-10 17:17:21 -04:00
parent bb5057c063
commit fc0acb020f
197 changed files with 63438 additions and 53007 deletions

View File

@@ -123,6 +123,7 @@ class ContactBulkEditForm(NetBoxModelBulkEditForm):
)
link = forms.URLField(
label=_('Link'),
assume_scheme='https',
required=False
)
description = forms.CharField(

View File

@@ -3,7 +3,7 @@ from typing import Annotated, List, TYPE_CHECKING
import strawberry
import strawberry_django
from extras.graphql.mixins import CustomFieldsMixin, TagsMixin
from extras.graphql.mixins import CustomFieldsMixin, TagsMixin, ContactsMixin
from netbox.graphql.types import BaseObjectType, OrganizationalObjectType, NetBoxObjectType
from tenancy import models
from .filters import *
@@ -51,16 +51,14 @@ __all__ = (
# Tenants
#
@strawberry_django.type(
models.Tenant,
fields='__all__',
filters=TenantFilter,
pagination=True
)
class TenantType(NetBoxObjectType):
class TenantType(ContactsMixin, NetBoxObjectType):
group: Annotated['TenantGroupType', strawberry.lazy('tenancy.graphql.types')] | None
contacts: List[Annotated['ContactType', strawberry.lazy('tenancy.graphql.types')]]
asns: List[Annotated['ASNType', strawberry.lazy('ipam.graphql.types')]]
circuits: List[Annotated['CircuitType', strawberry.lazy('circuits.graphql.types')]]
sites: List[Annotated['SiteType', strawberry.lazy('dcim.graphql.types')]]
@@ -104,7 +102,6 @@ class TenantGroupType(OrganizationalObjectType):
# Contacts
#
@strawberry_django.type(
models.Contact,
fields='__all__',

View File

@@ -130,7 +130,8 @@ class ContactAssignmentTable(NetBoxTable):
)
contact_link = tables.Column(
accessor=Accessor('contact__link'),
verbose_name=_('Contact Link')
verbose_name=_('Contact Link'),
linkify=lambda value: value,
)
contact_description = tables.Column(
accessor=Accessor('contact__description'),