1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
netbox-community-netbox/netbox/ipam/graphql/__init__.py
2021-06-25 10:14:35 -04:00

12 lines
441 B
Python

import graphene
from graphene_django.converter import convert_django_field
from ipam.fields import IPAddressField, IPNetworkField
@convert_django_field.register(IPAddressField)
@convert_django_field.register(IPNetworkField)
def convert_field_to_string(field, registry=None):
# TODO: Update to use get_django_field_description under django_graphene v3.0
return graphene.String(description=field.help_text, required=not field.null)