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

Add support for custom field data

This commit is contained in:
jeremystretch
2021-06-21 12:13:20 -04:00
parent 6a07f66cfc
commit 930ca8d9a1

View File

@ -1,4 +1,5 @@
import graphene
from graphene.types.generic import GenericScalar
from graphene_django import DjangoObjectType
__all__ = (
@ -22,11 +23,17 @@ class BaseObjectType(DjangoObjectType):
class ObjectType(BaseObjectType):
# TODO: Custom fields support
"""
Extends BaseObjectType with support for custom field data.
"""
custom_fields = GenericScalar()
class Meta:
abstract = True
def resolve_custom_fields(self, info):
return self.custom_field_data
class TaggedObjectType(ObjectType):
"""