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:
@@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user