summaryrefslogtreecommitdiff
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:17:27 +0000
commite10c5a8fdda3753581f1e9e74bc3a2d6b1d34a9c (patch)
tree397afd32dbc546e37f2d1260a4c6e9f684e4126a
parent22d292e23b1b60fd5c304b3d867ecf70860e7048 (diff)
[1.7.x] Better migration docs for get_query_set -> get_queryset
This way they won't need to fix things again when get_query_set disappears Backport of 91e2780dfba5609b0f83d51aee1cf7e8fe78b1f7 from master
-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 8737d08571..5a46d45960 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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~