mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-11 00:32:24 +03:00
parent
b659aa62bd
commit
f9c5bc3e20
|
@ -25,7 +25,7 @@ class DjangoListField(Field):
|
|||
_type = _type.of_type
|
||||
|
||||
# Django would never return a Set of None vvvvvvv
|
||||
super(DjangoListField, self).__init__(List(NonNull(_type)), *args, **kwargs)
|
||||
super().__init__(List(NonNull(_type)), *args, **kwargs)
|
||||
|
||||
assert issubclass(
|
||||
self._underlying_type, DjangoObjectType
|
||||
|
@ -80,7 +80,7 @@ class DjangoConnectionField(ConnectionField):
|
|||
graphene_settings.RELAY_CONNECTION_ENFORCE_FIRST_OR_LAST,
|
||||
)
|
||||
kwargs.setdefault("offset", Int())
|
||||
super(DjangoConnectionField, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
@property
|
||||
def type(self):
|
||||
|
|
|
@ -25,7 +25,7 @@ class DjangoFilterConnectionField(DjangoConnectionField):
|
|||
self._filtering_args = None
|
||||
self._extra_filter_meta = extra_filter_meta
|
||||
self._base_args = None
|
||||
super(DjangoFilterConnectionField, self).__init__(type, *args, **kwargs)
|
||||
super().__init__(type, *args, **kwargs)
|
||||
|
||||
@property
|
||||
def args(self):
|
||||
|
@ -71,7 +71,7 @@ class DjangoFilterConnectionField(DjangoConnectionField):
|
|||
kwargs[k] = v
|
||||
return kwargs
|
||||
|
||||
qs = super(DjangoFilterConnectionField, cls).resolve_queryset(
|
||||
qs = super().resolve_queryset(
|
||||
connection, iterable, info, args
|
||||
)
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ class GlobalIDFilter(Filter):
|
|||
_id = None
|
||||
if value is not None:
|
||||
_, _id = from_global_id(value)
|
||||
return super(GlobalIDFilter, self).filter(qs, _id)
|
||||
return super().filter(qs, _id)
|
||||
|
||||
|
||||
class GlobalIDMultipleChoiceFilter(MultipleChoiceFilter):
|
||||
|
@ -25,4 +25,4 @@ class GlobalIDMultipleChoiceFilter(MultipleChoiceFilter):
|
|||
|
||||
def filter(self, qs, value):
|
||||
gids = [from_global_id(v)[1] for v in value]
|
||||
return super(GlobalIDMultipleChoiceFilter, self).filter(qs, gids)
|
||||
return super().filter(qs, gids)
|
||||
|
|
|
@ -23,4 +23,4 @@ class ListFilter(TypedFilter):
|
|||
else:
|
||||
return qs.none()
|
||||
else:
|
||||
return super(ListFilter, self).filter(qs, value)
|
||||
return super().filter(qs, value)
|
||||
|
|
|
@ -12,7 +12,7 @@ class TypedFilter(Filter):
|
|||
|
||||
def __init__(self, input_type=None, *args, **kwargs):
|
||||
self._input_type = input_type
|
||||
super(TypedFilter, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
@property
|
||||
def input_type(self):
|
||||
|
|
|
@ -138,7 +138,7 @@ def test_filter_shortcut_filterset_context():
|
|||
|
||||
@property
|
||||
def qs(self):
|
||||
qs = super(ArticleContextFilter, self).qs
|
||||
qs = super().qs
|
||||
return qs.filter(reporter=self.request.reporter)
|
||||
|
||||
class Query(ObjectType):
|
||||
|
|
|
@ -99,7 +99,7 @@ class DjangoFormMutation(BaseDjangoFormMutation):
|
|||
_meta.fields = yank_fields_from_attrs(output_fields, _as=Field)
|
||||
|
||||
input_fields = yank_fields_from_attrs(input_fields, _as=InputField)
|
||||
super(DjangoFormMutation, cls).__init_subclass_with_meta__(
|
||||
super().__init_subclass_with_meta__(
|
||||
_meta=_meta, input_fields=input_fields, **options
|
||||
)
|
||||
|
||||
|
@ -164,7 +164,7 @@ class DjangoModelFormMutation(BaseDjangoFormMutation):
|
|||
_meta.fields = yank_fields_from_attrs(output_fields, _as=Field)
|
||||
|
||||
input_fields = yank_fields_from_attrs(input_fields, _as=InputField)
|
||||
super(DjangoModelFormMutation, cls).__init_subclass_with_meta__(
|
||||
super().__init_subclass_with_meta__(
|
||||
_meta=_meta, input_fields=input_fields, **options
|
||||
)
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ class SerializerMutation(ClientIDMutation):
|
|||
_meta.fields = yank_fields_from_attrs(output_fields, _as=Field)
|
||||
|
||||
input_fields = yank_fields_from_attrs(input_fields, _as=InputField)
|
||||
super(SerializerMutation, cls).__init_subclass_with_meta__(
|
||||
super().__init_subclass_with_meta__(
|
||||
_meta=_meta, input_fields=input_fields, **options
|
||||
)
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ def test_django_objecttype_with_custom_meta():
|
|||
@classmethod
|
||||
def __init_subclass_with_meta__(cls, **options):
|
||||
options.setdefault("_meta", ArticleTypeOptions(cls))
|
||||
super(ArticleType, cls).__init_subclass_with_meta__(**options)
|
||||
super().__init_subclass_with_meta__(**options)
|
||||
|
||||
class Article(ArticleType):
|
||||
class Meta:
|
||||
|
|
|
@ -255,7 +255,7 @@ class DjangoObjectType(ObjectType):
|
|||
_meta.fields = django_fields
|
||||
_meta.connection = connection
|
||||
|
||||
super(DjangoObjectType, cls).__init_subclass_with_meta__(
|
||||
super().__init_subclass_with_meta__(
|
||||
_meta=_meta, interfaces=interfaces, **options
|
||||
)
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ class HttpError(Exception):
|
|||
def __init__(self, response, message=None, *args, **kwargs):
|
||||
self.response = response
|
||||
self.message = message = message or response.content.decode()
|
||||
super(HttpError, self).__init__(message, *args, **kwargs)
|
||||
super().__init__(message, *args, **kwargs)
|
||||
|
||||
|
||||
def get_accepted_content_types(request):
|
||||
|
|
Loading…
Reference in New Issue
Block a user