From f15f46be1d459bcbbcd840fe7b187030af4df663 Mon Sep 17 00:00:00 2001 From: Oleg Smedyuk Date: Thu, 23 May 2019 13:30:25 +0300 Subject: [PATCH 1/5] drop support django <2 --- django_tablib/admin/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_tablib/admin/__init__.py b/django_tablib/admin/__init__.py index 60b9d51..e24387c 100644 --- a/django_tablib/admin/__init__.py +++ b/django_tablib/admin/__init__.py @@ -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 From e8dd4f8dda9e8ddeb29dc7afb2c5c043302b5fca Mon Sep 17 00:00:00 2001 From: Vladislav Yena Date: Tue, 25 Feb 2020 18:36:34 +0200 Subject: [PATCH 2/5] Fix ChangeList missing attr issue --- django_tablib/admin/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/django_tablib/admin/__init__.py b/django_tablib/admin/__init__.py index e24387c..f9757d4 100644 --- a/django_tablib/admin/__init__.py +++ b/django_tablib/admin/__init__.py @@ -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, @@ -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) From c985570fa28f8d30728fc60cb9ae0feea11b837b Mon Sep 17 00:00:00 2001 From: Vladislav Yena Date: Tue, 25 Feb 2020 20:08:10 +0200 Subject: [PATCH 3/5] Change legacy aggregate_select to annotation_select --- django_tablib/datasets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_tablib/datasets.py b/django_tablib/datasets.py index c683dee..f48da4d 100644 --- a/django_tablib/datasets.py +++ b/django_tablib/datasets.py @@ -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 From cc2f1e643d4b8e12ba7046d582503cf3a612d4f0 Mon Sep 17 00:00:00 2001 From: Vladimir Nosov Date: Wed, 8 Jul 2020 15:26:14 +0700 Subject: [PATCH 4/5] updated dependencies --- testproject/testproject/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testproject/testproject/settings.py b/testproject/testproject/settings.py index 10cd0f5..58fc929 100644 --- a/testproject/testproject/settings.py +++ b/testproject/testproject/settings.py @@ -40,7 +40,7 @@ 'tablib_test', ) -MIDDLEWARE_CLASSES = ( +MIDDLEWARE = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', From 9a6ae4f45cce4cbeb72627902906a63bdee5c903 Mon Sep 17 00:00:00 2001 From: Vladimir Nosov Date: Wed, 8 Jul 2020 15:34:47 +0700 Subject: [PATCH 5/5] reverted changes --- testproject/testproject/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testproject/testproject/settings.py b/testproject/testproject/settings.py index 58fc929..10cd0f5 100644 --- a/testproject/testproject/settings.py +++ b/testproject/testproject/settings.py @@ -40,7 +40,7 @@ 'tablib_test', ) -MIDDLEWARE = ( +MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware',