|
12 | 12 | """
|
13 | 13 | from __future__ import unicode_literals
|
14 | 14 |
|
| 15 | +import copy |
| 16 | +import inspect |
15 | 17 | import traceback
|
| 18 | +from collections import OrderedDict |
16 | 19 |
|
| 20 | +from django.core.exceptions import ValidationError as DjangoValidationError |
| 21 | +from django.core.exceptions import ImproperlyConfigured |
17 | 22 | from django.db import models
|
18 | 23 | from django.db.models import DurationField as ModelDurationField
|
19 | 24 | from django.db.models.fields import Field as DjangoModelField
|
20 | 25 | from django.db.models.fields import FieldDoesNotExist
|
| 26 | +from django.utils import six, timezone |
21 | 27 | from django.utils.functional import cached_property
|
22 | 28 | from django.utils.translation import ugettext_lazy as _
|
23 | 29 |
|
24 | 30 | from rest_framework.compat import JSONField as ModelJSONField
|
25 | 31 | from rest_framework.compat import postgres_fields, set_many, unicode_to_repr
|
26 |
| -from rest_framework.utils import model_meta |
| 32 | +from rest_framework.exceptions import ErrorDetail, ValidationError |
| 33 | +from rest_framework.fields import get_error_detail, set_value |
| 34 | +from rest_framework.settings import api_settings |
| 35 | +from rest_framework.utils import html, model_meta, representation |
27 | 36 | from rest_framework.utils.field_mapping import (
|
28 | 37 | ClassLookupDict, get_field_kwargs, get_nested_relation_kwargs,
|
29 | 38 | get_relation_kwargs, get_url_kwargs
|
|
42 | 51 | #
|
43 | 52 | # This helps keep the separation between model fields, form fields, and
|
44 | 53 | # serializer fields more explicit.
|
| 54 | +from rest_framework.fields import ( # NOQA # isort:skip |
| 55 | + BooleanField, CharField, ChoiceField, DateField, DateTimeField, DecimalField, |
| 56 | + DictField, DurationField, EmailField, Field, FileField, FilePathField, FloatField, |
| 57 | + HiddenField, IPAddressField, ImageField, IntegerField, JSONField, ListField, |
| 58 | + ModelField, MultipleChoiceField, NullBooleanField, ReadOnlyField, RegexField, |
| 59 | + SerializerMethodField, SlugField, TimeField, URLField, UUIDField, |
| 60 | +) |
| 61 | +from rest_framework.relations import ( # NOQA # isort:skip |
| 62 | + HyperlinkedIdentityField, HyperlinkedRelatedField, ManyRelatedField, |
| 63 | + PrimaryKeyRelatedField, RelatedField, SlugRelatedField, StringRelatedField, |
| 64 | +) |
45 | 65 |
|
46 |
| -from rest_framework.fields import * # NOQA # isort:skip |
47 |
| -from rest_framework.relations import * # NOQA # isort:skip |
| 66 | +# Non-field imports, but public API |
| 67 | +from rest_framework.fields import ( # NOQA # isort:skip |
| 68 | + CreateOnlyDefault, CurrentUserDefault, SkipField, empty |
| 69 | +) |
| 70 | +from rest_framework.relations import Hyperlink, PKOnlyObject # NOQA # isort:skip |
48 | 71 |
|
49 | 72 | # We assume that 'validators' are intended for the child serializer,
|
50 | 73 | # rather than the parent serializer.
|
|
0 commit comments