mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-11 08:42:32 +03:00
Cleaned up used imports and variables.
This commit is contained in:
parent
fe66b48d38
commit
ac00878cac
|
@ -156,8 +156,8 @@ class DjangoConnectionField(ConnectionField):
|
||||||
# AssertionError
|
# AssertionError
|
||||||
after = min(get_offset_with_default(args.get("after"), -1) + 1, list_length)
|
after = min(get_offset_with_default(args.get("after"), -1) + 1, list_length)
|
||||||
|
|
||||||
if max_limit is not None and args.get("first", None) == None:
|
if max_limit is not None and args.get("first", None) is None:
|
||||||
if args.get("last", None) != None:
|
if args.get("last", None) is not None:
|
||||||
after = list_length - args["last"]
|
after = list_length - args["last"]
|
||||||
else:
|
else:
|
||||||
args["first"] = max_limit
|
args["first"] = max_limit
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import itertools
|
import itertools
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django_filters import Filter, MultipleChoiceFilter
|
|
||||||
from django_filters.filterset import BaseFilterSet, FilterSet
|
from django_filters.filterset import BaseFilterSet, FilterSet
|
||||||
from django_filters.filterset import FILTER_FOR_DBFIELD_DEFAULTS
|
from django_filters.filterset import FILTER_FOR_DBFIELD_DEFAULTS
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,6 @@ from graphene.types.utils import yank_fields_from_attrs
|
||||||
from graphene_django.constants import MUTATION_ERRORS_FLAG
|
from graphene_django.constants import MUTATION_ERRORS_FLAG
|
||||||
from graphene_django.registry import get_global_registry
|
from graphene_django.registry import get_global_registry
|
||||||
|
|
||||||
|
|
||||||
from django.core.exceptions import ValidationError
|
|
||||||
from django.db import connection
|
|
||||||
|
|
||||||
from ..types import ErrorType
|
from ..types import ErrorType
|
||||||
from .converter import convert_form_field
|
from .converter import convert_form_field
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1 @@
|
||||||
import graphene
|
|
||||||
|
|
||||||
from ..types import ErrorType # noqa Import ErrorType for backwards compatability
|
from ..types import ErrorType # noqa Import ErrorType for backwards compatability
|
||||||
|
|
|
@ -2,10 +2,8 @@ import warnings
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from typing import Type
|
from typing import Type
|
||||||
|
|
||||||
from django.db.models import Model
|
|
||||||
from django.utils.functional import SimpleLazyObject
|
|
||||||
|
|
||||||
import graphene
|
import graphene
|
||||||
|
from django.db.models import Model
|
||||||
from graphene import Field
|
from graphene import Field
|
||||||
from graphene.relay import Connection, Node
|
from graphene.relay import Connection, Node
|
||||||
from graphene.types.objecttype import ObjectType, ObjectTypeOptions
|
from graphene.types.objecttype import ObjectType, ObjectTypeOptions
|
||||||
|
@ -21,7 +19,6 @@ from .utils import (
|
||||||
is_valid_django_model,
|
is_valid_django_model,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
ALL_FIELDS = "__all__"
|
ALL_FIELDS = "__all__"
|
||||||
|
|
||||||
|
|
||||||
|
@ -108,12 +105,7 @@ def validate_fields(type_, model, fields, only_fields, exclude_fields):
|
||||||
(
|
(
|
||||||
'Excluding the custom field "{field_name}" on DjangoObjectType "{type_}" has no effect. '
|
'Excluding the custom field "{field_name}" on DjangoObjectType "{type_}" has no effect. '
|
||||||
'Either remove the custom field or remove the field from the "exclude" list.'
|
'Either remove the custom field or remove the field from the "exclude" list.'
|
||||||
).format(
|
).format(field_name=name, type_=type_)
|
||||||
field_name=name,
|
|
||||||
app_label=model._meta.app_label,
|
|
||||||
object_name=model._meta.object_name,
|
|
||||||
type_=type_,
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
if not hasattr(model, name):
|
if not hasattr(model, name):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user