Răsfoiți Sursa

9856 fix extas FK

Arthur 1 an în urmă
părinte
comite
12cca5d0a0
1 a modificat fișierele cu 13 adăugiri și 7 ștergeri
  1. 13 7
      netbox/extras/graphql/types.py

+ 13 - 7
netbox/extras/graphql/types.py

@@ -35,7 +35,8 @@ __all__ = (
     filters=ConfigContextFilter
     filters=ConfigContextFilter
 )
 )
 class ConfigContextType(ObjectType):
 class ConfigContextType(ObjectType):
-    pass
+    data_source: Annotated["DataSourceType", strawberry.lazy('core.graphql.types')] | None
+    data_file: Annotated["DataFileType", strawberry.lazy('core.graphql.types')] | None
 
 
     @strawberry_django.field
     @strawberry_django.field
     def roles(self) -> List[Annotated["DeviceRoleType", strawberry.lazy('dcim.graphql.types')]]:
     def roles(self) -> List[Annotated["DeviceRoleType", strawberry.lazy('dcim.graphql.types')]]:
@@ -96,6 +97,8 @@ class ConfigContextType(ObjectType):
     filters=ConfigTemplateFilter
     filters=ConfigTemplateFilter
 )
 )
 class ConfigTemplateType(TagsMixin, ObjectType):
 class ConfigTemplateType(TagsMixin, ObjectType):
+    data_source: Annotated["DataSourceType", strawberry.lazy('core.graphql.types')] | None
+    data_file: Annotated["DataFileType", strawberry.lazy('core.graphql.types')] | None
 
 
     @strawberry_django.field
     @strawberry_django.field
     def virtualmachines(self) -> List[Annotated["VirtualMachineType", strawberry.lazy('virtualization.graphql.types')]]:
     def virtualmachines(self) -> List[Annotated["VirtualMachineType", strawberry.lazy('virtualization.graphql.types')]]:
@@ -120,7 +123,8 @@ class ConfigTemplateType(TagsMixin, ObjectType):
     filters=CustomFieldFilter
     filters=CustomFieldFilter
 )
 )
 class CustomFieldType(ObjectType):
 class CustomFieldType(ObjectType):
-    pass
+    object_type: Annotated["ContentTypeType", strawberry.lazy('netbox.graphql.types')] | None
+    choice_set: Annotated["CustomFieldChoiceSetType", strawberry.lazy('extras.graphql.types')] | None
 
 
 
 
 @strawberry_django.type(
 @strawberry_django.type(
@@ -155,7 +159,8 @@ class CustomLinkType(ObjectType):
     filters=ExportTemplateFilter
     filters=ExportTemplateFilter
 )
 )
 class ExportTemplateType(ObjectType):
 class ExportTemplateType(ObjectType):
-    pass
+    data_source: Annotated["DataSourceType", strawberry.lazy('core.graphql.types')] | None
+    data_file: Annotated["DataFileType", strawberry.lazy('core.graphql.types')] | None
 
 
 
 
 @strawberry_django.type(
 @strawberry_django.type(
@@ -164,7 +169,7 @@ class ExportTemplateType(ObjectType):
     filters=ImageAttachmentFilter
     filters=ImageAttachmentFilter
 )
 )
 class ImageAttachmentType(BaseObjectType):
 class ImageAttachmentType(BaseObjectType):
-    pass
+    content_type: Annotated["ContentTypeType", strawberry.lazy('netbox.graphql.types')] | None
 
 
 
 
 @strawberry_django.type(
 @strawberry_django.type(
@@ -173,7 +178,8 @@ class ImageAttachmentType(BaseObjectType):
     filters=JournalEntryFilter
     filters=JournalEntryFilter
 )
 )
 class JournalEntryType(CustomFieldsMixin, TagsMixin, ObjectType):
 class JournalEntryType(CustomFieldsMixin, TagsMixin, ObjectType):
-    pass
+    assigned_object_type: Annotated["ContentTypeType", strawberry.lazy('netbox.graphql.types')] | None
+    created_by: Annotated["UserType", strawberry.lazy('users.graphql.types')] | None
 
 
 
 
 @strawberry_django.type(
 @strawberry_django.type(
@@ -191,7 +197,7 @@ class ObjectChangeType(BaseObjectType):
     filters=SavedFilterFilter
     filters=SavedFilterFilter
 )
 )
 class SavedFilterType(ObjectType):
 class SavedFilterType(ObjectType):
-    pass
+    user: Annotated["UserType", strawberry.lazy('users.graphql.types')] | None
 
 
 
 
 @strawberry_django.type(
 @strawberry_django.type(
@@ -222,4 +228,4 @@ class WebhookType(OrganizationalObjectType):
     filters=EventRuleFilter
     filters=EventRuleFilter
 )
 )
 class EventRuleType(OrganizationalObjectType):
 class EventRuleType(OrganizationalObjectType):
-    pass
+    action_object_type: Annotated["ContentTypeType", strawberry.lazy('netbox.graphql.types')] | None