diff options
| author | Tom Christie | 2012-10-17 15:41:57 +0100 | 
|---|---|---|
| committer | Tom Christie | 2012-10-17 15:41:57 +0100 | 
| commit | cab4a2a5ad17545ac435785bf55b0b3a6c8f932c (patch) | |
| tree | 9f7ede0e3a81e65ba952b068b00d49b6764e0adc /docs/api-guide | |
| parent | b5daa40852fb5936e6cddb31ecda5c4b40175cd4 (diff) | |
| download | django-rest-framework-cab4a2a5ad17545ac435785bf55b0b3a6c8f932c.tar.bz2 | |
Split up doc sections more cleanly
Diffstat (limited to 'docs/api-guide')
| -rw-r--r-- | docs/api-guide/exceptions.md | 4 | ||||
| -rw-r--r-- | docs/api-guide/permissions.md | 5 | ||||
| -rw-r--r-- | docs/api-guide/settings.md | 4 | ||||
| -rw-r--r-- | docs/api-guide/throttling.md | 4 | ||||
| -rw-r--r-- | docs/api-guide/views.md | 4 | 
5 files changed, 19 insertions, 2 deletions
| diff --git a/docs/api-guide/exceptions.md b/docs/api-guide/exceptions.md index c3bdb7b9..33cf1ca8 100644 --- a/docs/api-guide/exceptions.md +++ b/docs/api-guide/exceptions.md @@ -33,6 +33,10 @@ Might recieve an error response indicating that the `DELETE` method is not allow      {"detail": "Method 'DELETE' not allowed."} +--- + +# API Reference +  ## APIException  **Signature:** `APIException(detail=None)` diff --git a/docs/api-guide/permissions.md b/docs/api-guide/permissions.md index eb290849..b25b52be 100644 --- a/docs/api-guide/permissions.md +++ b/docs/api-guide/permissions.md @@ -54,6 +54,8 @@ Or, if you're using the `@api_view` decorator with function based views.          }          return Response(content) +--- +  # API Reference  ## IsAuthenticated @@ -88,12 +90,15 @@ To use custom model permissions, override `DjangoModelPermissions` and set the `  The `DjangoModelPermissions` class also supports object-level permissions.  Third-party authorization backends such as [django-guardian][guardian] that provide object-level permissions should work just fine with `DjangoModelPermissions` without any custom configuration required. +--- +  # Custom permissions  To implement a custom permission, override `BasePermission` and implement the `.has_permission(self, request, view, obj=None)` method.  The method should return `True` if the request should be granted access, and `False` otherwise. +  [cite]: https://developer.apple.com/library/mac/#documentation/security/Conceptual/AuthenticationAndAuthorizationGuide/Authorization/Authorization.html  [authentication]: authentication.md  [throttling]: throttling.md diff --git a/docs/api-guide/settings.md b/docs/api-guide/settings.md index f473128e..84acd797 100644 --- a/docs/api-guide/settings.md +++ b/docs/api-guide/settings.md @@ -30,6 +30,10 @@ you should use the `api_settings` object.  For example.  The `api_settings` object will check for any user-defined settings, and otherwise fallback to the default values.  Any setting that uses string import paths to refer to a class will automatically import and return the referenced class, instead of the string literal. +--- + +# API Reference +  ## DEFAULT_RENDERERS  A list or tuple of renderer classes, that determines the default set of renderers that may be used when returning a `Response` object. diff --git a/docs/api-guide/throttling.md b/docs/api-guide/throttling.md index 3fb95ae3..22e34187 100644 --- a/docs/api-guide/throttling.md +++ b/docs/api-guide/throttling.md @@ -63,6 +63,8 @@ Or, if you're using the `@api_view` decorator with function based views.          }          return Response(content) +--- +  # API Reference  ## AnonRateThrottle @@ -144,6 +146,8 @@ For example, given the following views...  User requests to either `ContactListView` or `ContactDetailView` would be restricted to a total of 1000 requests per-day.  User requests to `UploadView` would be restricted to 20 requests per day. +--- +  # Custom throttles  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. diff --git a/docs/api-guide/views.md b/docs/api-guide/views.md index cbfa2e28..77349252 100644 --- a/docs/api-guide/views.md +++ b/docs/api-guide/views.md @@ -33,8 +33,8 @@ For example:              """              Return a list of all users.              """ -            users = [user.username for user in User.objects.all()] -            return Response(users) +            usernames = [user.username for user in User.objects.all()] +            return Response(usernames)  ## API policy attributes | 
