diff options
| author | Tom Christie | 2013-04-29 14:08:38 +0100 | 
|---|---|---|
| committer | Tom Christie | 2013-04-29 14:08:38 +0100 | 
| commit | 0c1ab584d3d0898d47e0bce6beb5d7c39a55dd52 (patch) | |
| tree | c4528c913faaba99c49841f098fbddf348b55774 /docs/topics/2.3-announcement.md | |
| parent | 53f9d4a380ee0066cbee8382ae265ea6005d8c88 (diff) | |
| download | django-rest-framework-0c1ab584d3d0898d47e0bce6beb5d7c39a55dd52.tar.bz2 | |
Tweaks for preferring .queryset over .model
Diffstat (limited to 'docs/topics/2.3-announcement.md')
| -rw-r--r-- | docs/topics/2.3-announcement.md | 6 | 
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/topics/2.3-announcement.md b/docs/topics/2.3-announcement.md index e1bcde05..45095582 100644 --- a/docs/topics/2.3-announcement.md +++ b/docs/topics/2.3-announcement.md @@ -138,7 +138,7 @@ Note that the relevant methods have always been private APIs, and the docstrings  ## Explict view attributes -The usage of `model` attribute in generic Views is still supported, but it's usage is being discouraged in favour of using explict `queryset` and `serializer_class` attributes. +The usage of `model` attribute in generic Views is still supported, but it's usage is being discouraged in favour of the more explict `queryset` attribute.  For example, the following is now the recommended style for using generic views: @@ -146,9 +146,9 @@ For example, the following is now the recommended style for using generic views:          queryset = MyModel.objects.all()          serializer_class = MyModelSerializer -Using explict `queryset` and `serializer_class` attributes makes the functioning of the view more clear than using the shortcut `model` attribute. +Using an explict `queryset` attribute makes the functioning of the view more clear than using the shortcut `model` attribute. -It also makes it the usage of overridden `get_queryset()` or `get_serializer_class()` methods more obvious. +It also makes the usage of an overridden `get_queryset()` method more obvious.      class AccountListView(generics.RetrieveAPIView):          serializer_class = MyModelSerializer  | 
