Skip to content

Commit

Permalink
Renamed get_query_set to get_queryset to get Django categories to wor…
Browse files Browse the repository at this point in the history
…k in Django 1.7. I'm not sure of a good way to make this work in Django 1.6.
  • Loading branch information
epicserve authored and coordt committed Jun 9, 2015
1 parent 77d0903 commit 58abcc7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion categories/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def active(self):
"""
Only categories that are active
"""
return self.get_query_set().filter(active=True)
return self.get_queryset().filter(active=True)


class CategoryBase(MPTTModel):
Expand Down
10 changes: 5 additions & 5 deletions categories/editor/tree_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def get_ordering(self, request=None, queryset=None):
else:
return []

def get_query_set(self, *args, **kwargs):
qs = super(TreeChangeList, self).get_query_set(*args, **kwargs).order_by('tree_id', 'lft')
def get_queryset(self, *args, **kwargs):
qs = super(TreeChangeList, self).get_queryset(*args, **kwargs).order_by('tree_id', 'lft')
return qs


Expand Down Expand Up @@ -171,7 +171,7 @@ def old_changelist_view(self, request, extra_context=None):
# Try to look up an action first, but if this isn't an action the POST
# will fall through to the bulk edit check, below.
if actions and request.method == 'POST':
response = self.response_action(request, queryset=cl.get_query_set())
response = self.response_action(request, queryset=cl.get_queryset())
if response:
return response

Expand Down Expand Up @@ -276,11 +276,11 @@ def changelist_view(self, request, extra_context=None, *args, **kwargs):
else:
return self.old_changelist_view(request, extra_context)

def queryset(self, request):
def get_queryset(self, request):
"""
Returns a QuerySet of all model instances that can be edited by the
admin site. This is used by changelist_view.
"""
qs = self.model._default_manager.get_query_set()
qs = self.model._default_manager.get_queryset()
qs.__class__ = TreeEditorQuerySet
return qs
4 changes: 2 additions & 2 deletions categories/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ def get_content_type(self, content_type):
"""
Get all the items of the given content type related to this item.
"""
qs = self.get_query_set()
qs = self.get_queryset()
return qs.filter(content_type__name=content_type)

def get_relation_type(self, relation_type):
"""
Get all the items of the given relationship type related to this item.
"""
qs = self.get_query_set()
qs = self.get_queryset()
return qs.filter(relation_type=relation_type)


Expand Down

0 comments on commit 58abcc7

Please sign in to comment.