mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-26 03:23:59 +03:00
Latest docs build
This commit is contained in:
parent
7dc3dbbad1
commit
9476365e6b
|
@ -6,7 +6,7 @@
|
|||
<link href="http://www.django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
|
||||
<link rel="canonical" href="http://www.django-rest-framework.org/api-guide/fields"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="Django, API, REST, Serializer fields, Generic Fields, Typed Fields, Custom fields">
|
||||
<meta name="description" content="Django, API, REST, Serializer fields, Generic Fields, Typed Fields, Custom fields, Third party packages">
|
||||
<meta name="author" content="Tom Christie">
|
||||
|
||||
<!-- Le styles -->
|
||||
|
@ -193,6 +193,8 @@
|
|||
<li><a href="#imagefield">ImageField</a></li>
|
||||
<li class="main"><a href="#custom-fields">Custom fields</a></li>
|
||||
<li><a href="#examples">Examples</a></li>
|
||||
<li class="main"><a href="#third-party-packages">Third party packages</a></li>
|
||||
<li><a href="#drf-compound-fields">DRF Compound Fields</a></li>
|
||||
|
||||
<div>
|
||||
|
||||
|
@ -434,6 +436,9 @@ class ColourField(serializers.WritableField):
|
|||
"""
|
||||
return obj.__class__
|
||||
</code></pre>
|
||||
<h1 id="third-party-packages">Third party packages</h1>
|
||||
<h2 id="drf-compound-fields">DRF Compound Fields</h2>
|
||||
<p>The <a href="http://drf-compound-fields.readthedocs.org">drf-compound-fields</a> package provides "compound" serializer fields, such as lists of simple values, which can be described by other fields rather than serializers with the <code>many=True</code> 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.</p>
|
||||
</div><!--/span-->
|
||||
</div><!--/row-->
|
||||
</div><!--/.fluid-container-->
|
||||
|
|
|
@ -408,10 +408,12 @@ class ProductFilter(django_filters.FilterSet):
|
|||
<p>For example:</p>
|
||||
<pre class="prettyprint lang-py"><code>search_fields = ('=username', '=email')
|
||||
</code></pre>
|
||||
<p>By default, the search parameter is named <code>'search</code>', but this may be overridden with the <code>SEARCH_PARAM</code> setting.</p>
|
||||
<p>For more details, see the <a href="https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.search_fields">Django documentation</a>.</p>
|
||||
<hr />
|
||||
<h2 id="orderingfilter">OrderingFilter</h2>
|
||||
<p>The <code>OrderingFilter</code> class supports simple query parameter controlled ordering of results. To specify the result order, set a query parameter named <code>'ordering'</code> to the required field name. For example:</p>
|
||||
<p>The <code>OrderingFilter</code> class supports simple query parameter controlled ordering of results. By default, the query parameter is named <code>'ordering'</code>, but this may by overridden with the <code>ORDERING_PARAM</code> setting.</p>
|
||||
<p>For example, to order users by username:</p>
|
||||
<pre class="prettyprint lang-py"><code>http://example.com/api/users?ordering=username
|
||||
</code></pre>
|
||||
<p>The client may also specify reverse orderings by prefixing the field name with '-', like so:</p>
|
||||
|
|
|
@ -298,6 +298,12 @@ If set to <code>None</code> then generic filtering is disabled.</p>
|
|||
<pre class="prettyprint lang-py"><code>GET http://example.com/api/accounts?page_size=999
|
||||
</code></pre>
|
||||
<p>Default: <code>None</code></p>
|
||||
<h3 id="search_param">SEARCH_PARAM</h3>
|
||||
<p>The name of a query paramater, which can be used to specify the search term used by <code>SearchFilter</code>.</p>
|
||||
<p>Default: <code>search</code></p>
|
||||
<h4 id="ordering_param">ORDERING_PARAM</h4>
|
||||
<p>The name of a query paramater, which can be used to specify the ordering of results returned by <code>OrderingFilter</code>.</p>
|
||||
<p>Default: <code>ordering</code></p>
|
||||
<hr />
|
||||
<h2 id="authentication-settings">Authentication settings</h2>
|
||||
<p><em>The following settings control the behavior of unauthenticated requests.</em></p>
|
||||
|
|
Loading…
Reference in New Issue
Block a user