From ccd2b0117d9c26199b1862a302b1eb06dd2f07b2 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 10 Oct 2012 10:02:37 +0100 Subject: Permissions and throttles no longer have a view attribute on self. Explicitly passed to .has_permissions(request, view, obj=None) / .allow_request(request, view) --- docs/api-guide/throttling.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/api-guide/throttling.md') diff --git a/docs/api-guide/throttling.md b/docs/api-guide/throttling.md index 7861e9ba..0e228905 100644 --- a/docs/api-guide/throttling.md +++ b/docs/api-guide/throttling.md @@ -144,8 +144,8 @@ User requests to either `ContactListView` or `ContactDetailView` would be restri ## Custom throttles -To create a custom throttle, override `BaseThrottle` and implement `.allow_request(request)`. The method should return `True` if the request should be allowed, and `False` otherwise. +To create a custom throttle, override `BaseThrottle` and implement `.allow_request(request, view)`. The method should return `True` if the request should be allowed, and `False` otherwise. -Optionally you may also override the `.wait()` method. If implemented, `.wait()` should return a recomended number of seconds to wait before attempting the next request, or `None`. The `.wait()` method will only be called if `.check_throttle()` has previously returned `False`. +Optionally you may also override the `.wait()` method. If implemented, `.wait()` should return a recomended number of seconds to wait before attempting the next request, or `None`. The `.wait()` method will only be called if `.allow_request()` has previously returned `False`. [permissions]: permissions.md -- cgit v1.2.3