From 9476365e6b0342a9468051a71ee8b26c4561beb4 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 17 Mar 2014 08:35:23 +0000 Subject: [PATCH] Latest docs build --- api-guide/fields.html | 15 ++++++++++----- api-guide/filtering.html | 4 +++- api-guide/settings.html | 6 ++++++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/api-guide/fields.html b/api-guide/fields.html index 2a0ac6ef4..1e8784113 100644 --- a/api-guide/fields.html +++ b/api-guide/fields.html @@ -6,7 +6,7 @@ - + @@ -193,6 +193,8 @@
  • ImageField
  • Custom fields
  • Examples
  • +
  • Third party packages
  • +
  • DRF Compound Fields
  • @@ -208,7 +210,7 @@

    fields.py

    Serializer fields

    -

    Each field in a Form class is responsible not only for validating data, but also for "cleaning" it — normalizing it to a consistent format.

    +

    Each field in a Form class is responsible not only for validating data, but also for "cleaning" it — normalizing it to a consistent format.

    Django documentation

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

    @@ -232,7 +234,7 @@ Set to false if this field is not required to be present during deserialization.

    Defaults to True.

    default

    -

    If set, this gives the default value that will be used for the field if no input value is supplied. If not set the default behavior is to not populate the attribute at all.

    +

    If set, this gives the default value that will be used for the field if no input value is supplied. If not set the default behavior is to not populate the attribute at all.

    May be set to a function or other callable, in which case the value will be evaluated each time it is used.

    validators

    A list of Django validators that should be used to validate deserialized values.

    @@ -277,7 +279,7 @@ class AccountSerializer(serializers.HyperlinkedModelSerializer):
    {
         'url': 'http://example.com/api/accounts/3/',
         'owner': 'http://example.com/api/users/12/',
    -    'name': 'FooCorp business account', 
    +    'name': 'FooCorp business account',
         'expired': True
     }
     
    @@ -346,7 +348,7 @@ or django.db.models.fields.TextField.

    In the case of JSON this means the default datetime representation uses the ECMA 262 date time string specification. This is a subset of ISO 8601 which uses millisecond precision, and includes the 'Z' suffix for the UTC timezone, for example: 2013-01-29T12:34:56.123Z.

    Signature: DateTimeField(format=None, input_formats=None)

    DateTime format strings may either be Python strftime formats which explicitly specify the format, or the special string 'iso-8601', which indicates that ISO 8601 style datetimes should be used. (eg '2013-01-29T12:34:56.000000Z')

    @@ -434,6 +436,9 @@ class ColourField(serializers.WritableField): """ return obj.__class__ +

    Third party packages

    +

    DRF Compound Fields

    +

    The drf-compound-fields package provides "compound" serializer fields, such as lists of simple values, which can be described by other fields rather than serializers with the many=True option. Also provided are fields for typed dictionaries and values that can be either a specific type or a list of items of that type.

    diff --git a/api-guide/filtering.html b/api-guide/filtering.html index f30c9826d..76b1375fc 100644 --- a/api-guide/filtering.html +++ b/api-guide/filtering.html @@ -408,10 +408,12 @@ class ProductFilter(django_filters.FilterSet):

    For example:

    search_fields = ('=username', '=email')
     
    +

    By default, the search parameter is named 'search', but this may be overridden with the SEARCH_PARAM setting.

    For more details, see the Django documentation.


    OrderingFilter

    -

    The OrderingFilter class supports simple query parameter controlled ordering of results. To specify the result order, set a query parameter named 'ordering' to the required field name. For example:

    +

    The OrderingFilter class supports simple query parameter controlled ordering of results. By default, the query parameter is named 'ordering', but this may by overridden with the ORDERING_PARAM setting.

    +

    For example, to order users by username:

    http://example.com/api/users?ordering=username
     

    The client may also specify reverse orderings by prefixing the field name with '-', like so:

    diff --git a/api-guide/settings.html b/api-guide/settings.html index 95f6d114a..b436bd999 100644 --- a/api-guide/settings.html +++ b/api-guide/settings.html @@ -298,6 +298,12 @@ If set to None then generic filtering is disabled.

    GET http://example.com/api/accounts?page_size=999
     

    Default: None

    +

    SEARCH_PARAM

    +

    The name of a query paramater, which can be used to specify the search term used by SearchFilter.

    +

    Default: search

    +

    ORDERING_PARAM

    +

    The name of a query paramater, which can be used to specify the ordering of results returned by OrderingFilter.

    +

    Default: ordering


    Authentication settings

    The following settings control the behavior of unauthenticated requests.