Tweak copy in throttling docs

This commit is contained in:
Tom Christie 2012-09-13 18:36:07 +01:00
parent 24d0f24527
commit 11452758bf

View File

@ -198,7 +198,7 @@ class UploadView(APIView):
</code></pre>
<p>User requests to either <code>ContactListView</code> or <code>ContactDetailView</code> would be restricted to a total of 1000 requests per-day. User requests to <code>UploadView</code> would be restricted to 20 requests per day.</p>
<h2 id="custom-throttles">Custom throttles</h2>
<p>To implement a custom throttle, override <code>BaseThrottle</code> and implement <code>.allow_request(request)</code>. The method should return <code>True</code> if the request should be allowed, and <code>False</code> otherwise.</p>
<p>To create a custom throttle, override <code>BaseThrottle</code> and implement <code>.allow_request(request)</code>. The method should return <code>True</code> if the request should be allowed, and <code>False</code> otherwise.</p>
<p>Optionally you may also override the <code>.wait()</code> method. If implemented, <code>.wait()</code> should return a recomended number of seconds to wait before attempting the next request, or <code>None</code>. The <code>.wait()</code> method will only be called if <code>.check_throttle()</code> has previously returned <code>False</code>.</p>
</div><!--/span-->
</div><!--/row-->