Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 2.0 compatibility, Fix TablibAdmin.get_tablib_queryset function #64

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion django_tablib/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import django
from distutils.version import LooseVersion
from django.contrib import admin
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.http import Http404


Expand Down Expand Up @@ -89,6 +89,7 @@ def get_tablib_queryset(self, request):
search_fields = (self.get_search_fields(request)
if hasattr(self, 'get_search_fields')
else self.search_fields)
sortable_by = self.get_sortable_by(request)

cl = ChangeList(
request,
Expand All @@ -103,6 +104,7 @@ def get_tablib_queryset(self, request):
self.list_max_show_all,
self.list_editable,
self,
sortable_by
)
return cl.get_queryset(request)

Expand Down
2 changes: 1 addition & 1 deletion django_tablib/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self, queryset, headers=None, encoding='utf-8'):
# django < 1.9
field_names = v_qs.field_names
headers.extend(field_names)
headers.extend(v_qs.query.aggregate_select)
headers.extend(v_qs.query.annotation_select)

self.header_list = headers
self.attr_list = headers
Expand Down