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

Add journal_entries to Graphene object types for all primary models

This commit is contained in:
jeremystretch
2021-08-03 13:58:08 -04:00
parent c416fce400
commit ea86321da8
7 changed files with 45 additions and 29 deletions

View File

@@ -4,6 +4,7 @@ from graphene.types.generic import GenericScalar
__all__ = (
'CustomFieldsMixin',
'ImageAttachmentsMixin',
'JournalEntriesMixin',
'TagsMixin',
)
@@ -22,6 +23,13 @@ class ImageAttachmentsMixin:
return self.images.restrict(info.context.user, 'view')
class JournalEntriesMixin:
journal_entries = graphene.List('extras.graphql.types.JournalEntryType')
def resolve_journal_entries(self, info):
return self.journal_entries.restrict(info.context.user, 'view')
class TagsMixin:
tags = graphene.List(graphene.String)