Skip to content

Commit

Permalink
[1.7.x] Corrected example code for get_query_set upgrade in 1.6 relea…
Browse files Browse the repository at this point in the history
…se notes

The conditional setting of `get_query_set` is required for correct behaviour
if running Django 1.8. The full gory details are here:

http://lukeplant.me.uk/blog/posts/handling-django%27s-get_query_set-rename-is-hard/

Backport of f87e552 from master
  • Loading branch information
spookylukey committed Jul 8, 2015
1 parent 2baf682 commit f23656c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/releases/1.6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,8 @@ a ``get_queryset_compat`` method as below and use it internally to your manager:
def get_queryset(self):
return YourCustomQuerySet() # for example

get_query_set = get_queryset
if django.VERSION < (1, 6):
get_query_set = get_queryset

def active(self): # for example
return self.get_queryset_compat().filter(active=True)
Expand Down

0 comments on commit f23656c

Please sign in to comment.