|
1 | 1 | from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping, Sequence |
2 | 2 | from typing import Any, Generic, NoReturn, TypeVar |
3 | | -from _typeshed import Self |
4 | 3 |
|
| 4 | +from _typeshed import Self |
5 | 5 | from django.core.exceptions import ValidationError as DjangoValidationError |
6 | 6 | from django.db import models |
7 | 7 | from django.db.models import DurationField as ModelDurationField |
8 | 8 | from django.db.models import Manager, Model, QuerySet |
9 | 9 | from django.db.models.fields import Field as DjangoModelField |
10 | | -from django.utils.translation import ugettext_lazy as _ |
11 | 10 | from django.utils.functional import cached_property |
12 | | -from typing_extensions import Literal |
13 | | - |
| 11 | +from django.utils.translation import ugettext_lazy as _ |
14 | 12 | from rest_framework.exceptions import APIException as APIException |
15 | 13 | from rest_framework.exceptions import AuthenticationFailed as AuthenticationFailed |
16 | 14 | from rest_framework.exceptions import ErrorDetail as ErrorDetail |
@@ -67,7 +65,8 @@ from rest_framework.relations import SlugRelatedField as SlugRelatedField |
67 | 65 | from rest_framework.relations import StringRelatedField as StringRelatedField |
68 | 66 | from rest_framework.utils.model_meta import FieldInfo, RelationInfo |
69 | 67 | from rest_framework.utils.serializer_helpers import BindingDict, BoundField, ReturnDict, ReturnList |
70 | | -from rest_framework.validators import Validator, UniqueTogetherValidator, BaseUniqueForValidator |
| 68 | +from rest_framework.validators import BaseUniqueForValidator, UniqueTogetherValidator, Validator |
| 69 | +from typing_extensions import Literal |
71 | 70 |
|
72 | 71 | LIST_SERIALIZER_KWARGS: Sequence[str] |
73 | 72 | ALL_FIELDS: str |
@@ -126,9 +125,7 @@ class SerializerMetaclass(type): |
126 | 125 | def as_serializer_error(exc: Exception) -> dict[str, list[ErrorDetail]]: ... |
127 | 126 |
|
128 | 127 | class Serializer( |
129 | | - BaseSerializer[ |
130 | | - _IN, |
131 | | - ], |
| 128 | + BaseSerializer[_IN], |
132 | 129 | metaclass=SerializerMetaclass, |
133 | 130 | ): |
134 | 131 | _declared_fields: dict[str, Field] |
|
0 commit comments