<p>This is nice, but it shows underlying model structure in REST API, which may
<p>This is nice, but it exposes the Django's double underscore convention as part of the API. If you instead want to explicitly name the filter argument you can instead explicitly include it on the <code>FilterSet</code> class:</p>
@@ -223,6 +236,9 @@ or if you override the <code>get_object</code> method on a generic view, then yo
...
@@ -223,6 +236,9 @@ or if you override the <code>get_object</code> method on a generic view, then yo
self.check_object_permissions(self.request, obj)
self.check_object_permissions(self.request, obj)
return obj
return obj
</code></pre>
</code></pre>
<h4id="limitations-of-object-level-permissions">Limitations of object level permissions</h4>
<p>For performance reasons the generic views will not automatically apply object level permissions to each instance in a queryset when returning a list of objects.</p>
<p>Often when you're using object level permissions you'll also want to <ahref="filtering">filter the queryset</a> appropriately, to ensure that users only have visibility onto instances that they are permitted to view.</p>
<h2id="setting-the-permission-policy">Setting the permission policy</h2>
<h2id="setting-the-permission-policy">Setting the permission policy</h2>
<p>The default permission policy may be set globally, using the <code>DEFAULT_PERMISSION_CLASSES</code> setting. For example.</p>
<p>The default permission policy may be set globally, using the <code>DEFAULT_PERMISSION_CLASSES</code> setting. For example.</p>
<p>If you want to be first in line when we start issuing invitations, please <ahref="http://brightapi.com">sign up here</a>.</p>
</div>
</div>
</ul>
</ul>
</div>
</div>
...
@@ -227,7 +240,7 @@
...
@@ -227,7 +240,7 @@
<li><ahref="api-guide/authentication">Authentication policies</a> including <ahref="api-guide/authentication#oauthauthentication">OAuth1a</a> and <ahref="api-guide/authentication#oauth2authentication">OAuth2</a> out of the box.</li>
<li><ahref="api-guide/authentication">Authentication policies</a> including <ahref="api-guide/authentication#oauthauthentication">OAuth1a</a> and <ahref="api-guide/authentication#oauth2authentication">OAuth2</a> out of the box.</li>
<li><ahref="api-guide/serializers">Serialization</a> that supports both <ahref="api-guide/serializers#modelserializer">ORM</a> and <ahref="api-guide/serializers#serializers">non-ORM</a> data sources.</li>
<li><ahref="api-guide/serializers">Serialization</a> that supports both <ahref="api-guide/serializers#modelserializer">ORM</a> and <ahref="api-guide/serializers#serializers">non-ORM</a> data sources.</li>
<li>Customizable all the way down - just use <ahref="api-guide/views#function-based-views">regular function-based views</a> if you don't need the <ahref="api-guide/generic-views">more</a><ahref="api-guide/viewsets">powerful</a><ahref="api-guide/routers">features</a>.</li>
<li>Customizable all the way down - just use <ahref="api-guide/views#function-based-views">regular function-based views</a> if you don't need the <ahref="api-guide/generic-views">more</a><ahref="api-guide/viewsets">powerful</a><ahref="api-guide/routers">features</a>.</li>
<li><ahref=".">Extensive documentation</a>, <ahref="https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework">great community support</a>, and a growing <ahref="https://www.djangopackages.com/grids/g/django-rest-framework/">package ecosystem</a>.</li>
<li><ahref=".">Extensive documentation</a>, and <ahref="https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework">great community support</a>.</li>
<li>Used and trusted by large companies such as <ahref="http://www.mozilla.org/en-US/about/">Mozilla</a> and <ahref="https://www.eventbrite.co.uk/about/">Eventbrite</a>.</li>
<li>Used and trusted by large companies such as <ahref="http://www.mozilla.org/en-US/about/">Mozilla</a> and <ahref="https://www.eventbrite.co.uk/about/">Eventbrite</a>.</li>
</ul>
</ul>
<hr/>
<hr/>
...
@@ -431,6 +444,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
...
@@ -431,6 +444,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>