mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-01-27 01:34:09 +03:00
Allow nodes to skip the registry
This commit is contained in:
parent
5d6c7f2dc3
commit
aed7229bae
|
@ -13,7 +13,8 @@ class Registry(object):
|
|||
# assert self.get_type_for_model(cls._meta.model) == cls, (
|
||||
# 'Multiple DjangoObjectTypes registered for "{}"'.format(cls._meta.model)
|
||||
# )
|
||||
self._registry[cls._meta.model] = cls
|
||||
if not getattr(cls._meta, 'skip_registry', False):
|
||||
self._registry[cls._meta.model] = cls
|
||||
|
||||
def get_type_for_model(self, model):
|
||||
return self._registry.get(model)
|
||||
|
|
|
@ -58,6 +58,7 @@ class DjangoObjectTypeMeta(ObjectTypeMeta):
|
|||
only_fields=(),
|
||||
exclude_fields=(),
|
||||
interfaces=(),
|
||||
skip_registry=False,
|
||||
registry=None
|
||||
)
|
||||
if DJANGO_FILTER_INSTALLED:
|
||||
|
|
Loading…
Reference in New Issue
Block a user