mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-26 03:24:07 +03:00
adding the option of defining a filterset_class in the Meta class
This commit is contained in:
parent
e77962bb0a
commit
9b1c1b4bad
|
@ -48,7 +48,11 @@ class DjangoFilterConnectionField(DjangoConnectionField):
|
|||
|
||||
@property
|
||||
def filterset_class(self):
|
||||
return get_filterset_class(self._filterset_class, **self.meta)
|
||||
if self.node_type()._meta.filterset_class:
|
||||
filterset_class = self.node_type()._meta.filterset_class
|
||||
else:
|
||||
filterset_class = get_filterset_class(self._filterset_class, **self.meta)
|
||||
return filterset_class
|
||||
|
||||
@property
|
||||
def filtering_args(self):
|
||||
|
|
|
@ -58,7 +58,8 @@ class DjangoObjectTypeMeta(ObjectTypeMeta):
|
|||
only_fields=(),
|
||||
exclude_fields=(),
|
||||
interfaces=(),
|
||||
registry=None
|
||||
registry=None,
|
||||
filterset_class=None
|
||||
)
|
||||
if DJANGO_FILTER_INSTALLED:
|
||||
# In case Django filter is available, then
|
||||
|
|
Loading…
Reference in New Issue
Block a user