From 0c1ab584d3d0898d47e0bce6beb5d7c39a55dd52 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 29 Apr 2013 14:08:38 +0100 Subject: Tweaks for preferring .queryset over .model --- docs/topics/2.3-announcement.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') 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 -- cgit v1.2.3