summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2014-11-24 10:09:39 +0000
committerLuke Plant <L.Plant.98@cantab.net>2014-11-24 10:09:39 +0000
commit91e2780dfba5609b0f83d51aee1cf7e8fe78b1f7 (patch)
tree1438632d7874e5cfc7eaa1c5cd094e044ac1e7b0 /docs
parent0d74209ef66111f29f122d5f5fdf8e2964890cc5 (diff)
Better migration docs for get_query_set -> get_queryset
This way they won't need to fix things again when get_query_set disappears
Diffstat (limited to 'docs')
-rw-r--r--docs/releases/1.6.txt6
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/releases/1.6.txt b/docs/releases/1.6.txt
index 1a49cdf2a6..a04984877a 100644
--- a/docs/releases/1.6.txt
+++ b/docs/releases/1.6.txt
@@ -1116,8 +1116,10 @@ you should rename the method and conditionally add an alias with the old name::
If you are writing a library that needs to call the ``get_queryset`` method and
must support old Django versions, you should write::
- method = getattr(some_manager, 'get_queryset', some_manager.get_query_set)
- method(params)
+ get_queryset = (some_manager.get_queryset
+ if hasattr(some_manager, 'get_queryset')
+ else some_manager.get_query_set)
+ return get_queryset() # etc
``shortcut`` view and URLconf
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~