diff options
| author | Kyle | 2014-07-28 10:19:42 -0700 | 
|---|---|---|
| committer | Kyle | 2014-07-28 10:19:42 -0700 | 
| commit | fc8eb76c2259ea64a19876f040db4d93e834d39d (patch) | |
| tree | 0f917f33d5c0ee817abf0979a0d60b3be9f2fc9f /docs/api-guide/generic-views.md | |
| parent | e40ffd60d44d736d7e27ff454cba1905f0becc26 (diff) | |
| download | django-rest-framework-fc8eb76c2259ea64a19876f040db4d93e834d39d.tar.bz2 | |
Issue #1707 - Add info about queryset property caching to get_queryset() docs.
Add documentation to the get_queryset() method of generic-views.md regarding
the caching of the queryset property.
Diffstat (limited to 'docs/api-guide/generic-views.md')
| -rwxr-xr-x | docs/api-guide/generic-views.md | 2 | 
1 files changed, 2 insertions, 0 deletions
| diff --git a/docs/api-guide/generic-views.md b/docs/api-guide/generic-views.md index b76c18cf..43c5782f 100755 --- a/docs/api-guide/generic-views.md +++ b/docs/api-guide/generic-views.md @@ -99,6 +99,8 @@ The following attributes are used to control pagination when used with list view  Returns the queryset that should be used for list views, and that should be used as the base for lookups in detail views.  Defaults to returning the queryset specified by the `queryset` attribute, or the default queryset for the model if the `model` shortcut is being used. +This method should always be used rather than accessing `self.queryset` directly, as `self.queryset` gets evaluated only once, and those results are cached for all subsequent requests. +  May be overridden to provide dynamic behavior such as returning a queryset that is specific to the user making the request.  For example: | 
