diff options
| author | Tom Christie | 2013-02-06 21:28:03 +0000 |
|---|---|---|
| committer | Tom Christie | 2013-02-06 21:28:03 +0000 |
| commit | c18fb0d6953940f63cd8747a5ce543d31999996f (patch) | |
| tree | 08915d4cf65b22ed24483f7371a36d1cd96d6482 /docs/api-guide | |
| parent | 123c6cbc7cebf797ed0b310a5a8d398fa6323ce4 (diff) | |
| download | django-rest-framework-c18fb0d6953940f63cd8747a5ce543d31999996f.tar.bz2 | |
Added a `post_save` hook. Closes #558.
Diffstat (limited to 'docs/api-guide')
| -rw-r--r-- | docs/api-guide/generic-views.md | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/api-guide/generic-views.md b/docs/api-guide/generic-views.md index 693e210d..20f1be63 100644 --- a/docs/api-guide/generic-views.md +++ b/docs/api-guide/generic-views.md @@ -131,6 +131,15 @@ Each of the generic views provided is built by combining one of the base views b Extends REST framework's `APIView` class, adding support for serialization of model instances and model querysets. +**Methods**: + +* `get_serializer_context(self)` - Returns a dictionary containing any extra context that should be supplied to the serializer. Defaults to including `'request'`, `'view'` and `'format'` keys. +* `get_serializer_class(self)` - Returns the class that should be used for the serializer. +* `get_serializer(self, instance=None, data=None, files=None, many=False, partial=False)` - Returns a serializer instance. +* `pre_save(self, obj)` - A hook that is called before saving an object. +* `post_save(self, obj, created=False)` - A hook that is called after saving an object. + + **Attributes**: * `model` - The model that should be used for this view. Used as a fallback for determining the serializer if `serializer_class` is not set, and as a fallback for determining the queryset if `queryset` is not set. Otherwise not required. |
