mirror of
https://github.com/netbox-community/netbox.git
synced 2026-03-27 11:51:50 +01:00
Merge main into feature
This commit is contained in:
@@ -123,6 +123,7 @@ class ContactBulkEditForm(NetBoxModelBulkEditForm):
|
||||
)
|
||||
link = forms.URLField(
|
||||
label=_('Link'),
|
||||
assume_scheme='https',
|
||||
required=False
|
||||
)
|
||||
description = forms.CharField(
|
||||
|
||||
@@ -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__',
|
||||
|
||||
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user