mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-05-10 10:53:42 +03:00
Refactor: modify the codebase to pass through the pre-commit hooks
This commit is contained in:
parent
6dc9b44fdb
commit
1602403d2f
|
@ -3,7 +3,6 @@ Provides generic filtering backends that can be used to filter the results
|
|||
returned by list views.
|
||||
"""
|
||||
import operator
|
||||
import warnings
|
||||
from functools import reduce
|
||||
|
||||
from django.core.exceptions import FieldDoesNotExist, ImproperlyConfigured
|
||||
|
@ -14,8 +13,6 @@ from django.utils.encoding import force_str
|
|||
from django.utils.text import smart_split, unescape_string_literal
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from rest_framework import RemovedInDRF317Warning
|
||||
from rest_framework.compat import coreapi, coreschema
|
||||
from rest_framework.fields import CharField
|
||||
from rest_framework.settings import api_settings
|
||||
|
||||
|
@ -256,9 +253,9 @@ class OrderingFilter(BaseFilterBackend):
|
|||
(field.source.replace('.', '__') or field_name, field.label)
|
||||
for field_name, field in serializer_class(context=context).fields.items()
|
||||
if (
|
||||
not getattr(field, 'write_only', False) and
|
||||
not field.source == '*' and
|
||||
field.source not in model_property_names
|
||||
not getattr(field, 'write_only', False) and
|
||||
not field.source == '*' and
|
||||
field.source not in model_property_names
|
||||
)
|
||||
]
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ be used for paginated responses.
|
|||
"""
|
||||
|
||||
import contextlib
|
||||
import warnings
|
||||
from base64 import b64decode, b64encode
|
||||
from collections import namedtuple
|
||||
from urllib import parse
|
||||
|
@ -15,8 +14,6 @@ from django.template import loader
|
|||
from django.utils.encoding import force_str
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from rest_framework import RemovedInDRF317Warning
|
||||
from rest_framework.compat import coreapi, coreschema
|
||||
from rest_framework.exceptions import NotFound
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.settings import api_settings
|
||||
|
|
|
@ -1,17 +1,10 @@
|
|||
import warnings
|
||||
from collections import Counter
|
||||
from urllib import parse
|
||||
|
||||
from django.db import models
|
||||
from django.utils.encoding import force_str
|
||||
|
||||
from rest_framework import RemovedInDRF317Warning, exceptions, serializers
|
||||
from rest_framework.compat import coreapi, coreschema, uritemplate
|
||||
from rest_framework.settings import api_settings
|
||||
|
||||
from .generators import BaseSchemaGenerator
|
||||
from .inspectors import ViewInspector
|
||||
from .utils import get_pk_description, is_list_view
|
||||
from rest_framework import serializers
|
||||
from rest_framework.compat import coreschema
|
||||
|
||||
|
||||
def common_path(paths):
|
||||
|
@ -186,6 +179,3 @@ def field_to_schema(field):
|
|||
)
|
||||
|
||||
return coreschema.String(title=title, description=description)
|
||||
|
||||
|
||||
å
|
||||
|
|
Loading…
Reference in New Issue
Block a user