mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 10:58:37 -06:00
17170 update api, detail view, graphql
This commit is contained in:
parent
771a9a2d4f
commit
c7827c7960
@ -18,8 +18,12 @@
|
||||
<h2 class="card-header">{% trans "Contact" %}</h2>
|
||||
<table class="table table-hover attr-table">
|
||||
<tr>
|
||||
<th scope="row">{% trans "Group" %}</th>
|
||||
<td>{{ object.group|linkify|placeholder }}</td>
|
||||
<th scope="row">{% trans "Groups" %}</th>
|
||||
<td>
|
||||
{% for group in object.groups.all %}
|
||||
{{ group|linkify|placeholder }}{% if not forloop.last %}, {% endif %}
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">{% trans "Name" %}</th>
|
||||
|
@ -43,7 +43,7 @@ class ContactRoleSerializer(NetBoxModelSerializer):
|
||||
|
||||
|
||||
class ContactSerializer(NetBoxModelSerializer):
|
||||
group = ContactGroupSerializer(nested=True, required=False, allow_null=True, default=None)
|
||||
groups = ContactGroupSerializer(many=True, nested=True, required=False, allow_null=True, default=None)
|
||||
|
||||
class Meta:
|
||||
model = Contact
|
||||
|
@ -97,7 +97,7 @@ class TenantGroupType(OrganizationalObjectType):
|
||||
|
||||
@strawberry_django.type(models.Contact, fields='__all__', filters=ContactFilter)
|
||||
class ContactType(ContactAssignmentsMixin, NetBoxObjectType):
|
||||
group: Annotated['ContactGroupType', strawberry.lazy('tenancy.graphql.types')] | None
|
||||
groups: List[Annotated['ContactGroupType', strawberry.lazy('tenancy.graphql.types')]]
|
||||
|
||||
|
||||
@strawberry_django.type(models.ContactRole, fields='__all__', filters=ContactRoleFilter)
|
||||
|
Loading…
Reference in New Issue
Block a user