diff --git a/api-guide/authentication.html b/api-guide/authentication.html index ef0f8ab14..84d8441c2 100644 --- a/api-guide/authentication.html +++ b/api-guide/authentication.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/api-guide/content-negotiation.html b/api-guide/content-negotiation.html index 7953a3e3c..c61b31532 100644 --- a/api-guide/content-negotiation.html +++ b/api-guide/content-negotiation.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/api-guide/exceptions.html b/api-guide/exceptions.html index 4337672ae..b27bfd4e1 100644 --- a/api-guide/exceptions.html +++ b/api-guide/exceptions.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/api-guide/fields.html b/api-guide/fields.html index d21b52d97..88ddb70bb 100644 --- a/api-guide/fields.html +++ b/api-guide/fields.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • @@ -101,6 +102,7 @@
  • Serializer fields
  • Generic Fields
  • Field
  • +
  • WritableField
  • ModelField
  • Typed Fields
  • BooleanField
  • @@ -115,6 +117,7 @@
  • ManyPrimaryKeyRelatedField
  • HyperlinkedRelatedField
  • ManyHyperlinkedRelatedField
  • +
  • HyperLinkedIdentityField
  • @@ -127,10 +130,18 @@

    Flat is better than nested.

    The Zen of Python

    +

    Note: The serializer fields are declared in fields.py, but by convention you should import them using from rest_framework import serializers and refer to fields as serializers.<FieldName>.

    +

    Serializer fields handle converting between primative values and internal datatypes. They also deal with validating input values, as well as retrieving and setting the values from their parent objects.

    Generic Fields

    Field

    +

    A generic, read-only field. You can use this field for any attribute that does not need to support write operations.

    +

    WritableField

    +

    A field that supports both read and

    ModelField

    +

    A generic field that can be tied to any arbitrary model field. The ModelField class delegates the task of serialization/deserialization to it's associated model field. This field can be used to create serializer fields for custom model fields, without having to create a new custom serializer field.

    +

    Signature: ModelField(model_field=<Django ModelField class>)

    Typed Fields

    +

    These fields represent basic datatypes, and support both reading and writing values.

    BooleanField

    CharField

    EmailField

    @@ -139,11 +150,12 @@

    IntegerField

    FloatField

    Relational Fields

    -

    Relational fields are used to represent model relationships.

    +

    Relational fields are used to represent model relationships. They can be applied to ForeignKey, ManyToManyField and OneToOneField relationships, as well as to reverse relationships, and custom relationships such as GenericForeignKey.

    PrimaryKeyRelatedField

    ManyPrimaryKeyRelatedField

    HyperlinkedRelatedField

    ManyHyperlinkedRelatedField

    +

    HyperLinkedIdentityField

    diff --git a/api-guide/format-suffixes.html b/api-guide/format-suffixes.html index 0f14e8216..ee51bd42d 100644 --- a/api-guide/format-suffixes.html +++ b/api-guide/format-suffixes.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/api-guide/generic-views.html b/api-guide/generic-views.html index 8a42ce7fd..9b7d5f95f 100644 --- a/api-guide/generic-views.html +++ b/api-guide/generic-views.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/api-guide/pagination.html b/api-guide/pagination.html index 978b37093..a0f9c46d2 100644 --- a/api-guide/pagination.html +++ b/api-guide/pagination.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/api-guide/parsers.html b/api-guide/parsers.html index d85a99260..9e8f5183c 100644 --- a/api-guide/parsers.html +++ b/api-guide/parsers.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/api-guide/permissions.html b/api-guide/permissions.html index cb8b804a2..d723bacaa 100644 --- a/api-guide/permissions.html +++ b/api-guide/permissions.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/api-guide/renderers.html b/api-guide/renderers.html index 268185783..8bdf01c06 100644 --- a/api-guide/renderers.html +++ b/api-guide/renderers.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/api-guide/requests.html b/api-guide/requests.html index ecad4e00f..ee0eca8a5 100644 --- a/api-guide/requests.html +++ b/api-guide/requests.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/api-guide/responses.html b/api-guide/responses.html index 39a7c557a..6c9a147d8 100644 --- a/api-guide/responses.html +++ b/api-guide/responses.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/api-guide/reverse.html b/api-guide/reverse.html index ea3cd38ce..77eeaa13b 100644 --- a/api-guide/reverse.html +++ b/api-guide/reverse.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/api-guide/serializers.html b/api-guide/serializers.html index 906a56a6a..30b4cfdf4 100644 --- a/api-guide/serializers.html +++ b/api-guide/serializers.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/api-guide/settings.html b/api-guide/settings.html index 63e6fc771..a529a72c8 100644 --- a/api-guide/settings.html +++ b/api-guide/settings.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/api-guide/status-codes.html b/api-guide/status-codes.html index 29d7a667f..fd297bc95 100644 --- a/api-guide/status-codes.html +++ b/api-guide/status-codes.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/api-guide/throttling.html b/api-guide/throttling.html index 3814cc50b..f7b3ea877 100644 --- a/api-guide/throttling.html +++ b/api-guide/throttling.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/api-guide/views.html b/api-guide/views.html index 41e40d894..3406f3998 100644 --- a/api-guide/views.html +++ b/api-guide/views.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/index.html b/index.html index ebeed863d..653c1a021 100644 --- a/index.html +++ b/index.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • @@ -179,6 +180,7 @@ pip install -r optionals.txt
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/topics/browsable-api.html b/topics/browsable-api.html index 09a328ade..5f93da4aa 100644 --- a/topics/browsable-api.html +++ b/topics/browsable-api.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/topics/changelog.html b/topics/changelog.html index aebea797d..886bff437 100644 --- a/topics/changelog.html +++ b/topics/changelog.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/topics/contributing.html b/topics/contributing.html index 3e447e484..a91d2dbf2 100644 --- a/topics/contributing.html +++ b/topics/contributing.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/topics/credits.html b/topics/credits.html index 6349bc799..90ae9f986 100644 --- a/topics/credits.html +++ b/topics/credits.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/topics/csrf.html b/topics/csrf.html index 7e18b4abe..ea347b225 100644 --- a/topics/csrf.html +++ b/topics/csrf.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/topics/formoverloading.html b/topics/formoverloading.html index 5882ffcb9..d372b6ac1 100644 --- a/topics/formoverloading.html +++ b/topics/formoverloading.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/topics/rest-hypermedia-hateoas.html b/topics/rest-hypermedia-hateoas.html index 127e6f8d2..6cd35b8ff 100644 --- a/topics/rest-hypermedia-hateoas.html +++ b/topics/rest-hypermedia-hateoas.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/tutorial/1-serialization.html b/tutorial/1-serialization.html index 43f05aa3c..6d1243bef 100644 --- a/tutorial/1-serialization.html +++ b/tutorial/1-serialization.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/tutorial/2-requests-and-responses.html b/tutorial/2-requests-and-responses.html index 2666f01dd..675951d8d 100644 --- a/tutorial/2-requests-and-responses.html +++ b/tutorial/2-requests-and-responses.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/tutorial/3-class-based-views.html b/tutorial/3-class-based-views.html index f85d1d2ce..fe4d77ae4 100644 --- a/tutorial/3-class-based-views.html +++ b/tutorial/3-class-based-views.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/tutorial/4-authentication-permissions-and-throttling.html b/tutorial/4-authentication-permissions-and-throttling.html index 72484dce4..59622a932 100644 --- a/tutorial/4-authentication-permissions-and-throttling.html +++ b/tutorial/4-authentication-permissions-and-throttling.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/tutorial/5-relationships-and-hyperlinked-apis.html b/tutorial/5-relationships-and-hyperlinked-apis.html index 57e9e4924..2595b987e 100644 --- a/tutorial/5-relationships-and-hyperlinked-apis.html +++ b/tutorial/5-relationships-and-hyperlinked-apis.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling
  • diff --git a/tutorial/6-resource-orientated-projects.html b/tutorial/6-resource-orientated-projects.html index 3d7f49fbf..962625daa 100644 --- a/tutorial/6-resource-orientated-projects.html +++ b/tutorial/6-resource-orientated-projects.html @@ -53,6 +53,7 @@
  • Parsers
  • Renderers
  • Serializers
  • +
  • Serializer fields
  • Authentication
  • Permissions
  • Throttling