From f8521a1b2449905a7f8eb55858e633f57e042b3b Mon Sep 17 00:00:00 2001 From: Jakub Janarek Date: Tue, 24 Nov 2020 12:16:02 +0000 Subject: [PATCH 1/9] fix FieldDoesNotExist import error for django 3.1+ --- datatableview/columns.py | 5 ++++- datatableview/datatables.py | 5 ++++- datatableview/utils.py | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/datatableview/columns.py b/datatableview/columns.py index 1895a4d6..587b42b3 100644 --- a/datatableview/columns.py +++ b/datatableview/columns.py @@ -11,7 +11,10 @@ import django from django.db import models from django.db.models import Model, Manager, Q -from django.db.models.fields import FieldDoesNotExist +try: + from django.db.models.fields import FieldDoesNotExist +except ImportError: + from django.core.exceptions import FieldDoesNotExist from django.core.exceptions import ObjectDoesNotExist from django.utils.encoding import smart_text from django.utils.safestring import mark_safe diff --git a/datatableview/datatables.py b/datatableview/datatables.py index 5eb17509..4251fee3 100644 --- a/datatableview/datatables.py +++ b/datatableview/datatables.py @@ -9,7 +9,10 @@ except ImportError: pass -from django.db.models.fields import FieldDoesNotExist +try: + from django.db.models.fields import FieldDoesNotExist +except ImportError: + from django.core.exceptions import FieldDoesNotExist from django.template.loader import render_to_string from django.db.models import QuerySet try: diff --git a/datatableview/utils.py b/datatableview/utils.py index 61e63728..4a688611 100644 --- a/datatableview/utils.py +++ b/datatableview/utils.py @@ -6,7 +6,10 @@ pass from django.db import models -from django.db.models.fields import FieldDoesNotExist +try: + from django.db.models.fields import FieldDoesNotExist +except ImportError: + from django.core.exceptions import FieldDoesNotExist from django.utils.text import smart_split From 4d3eabb0b7a67a76ab557eb44ce324383e99aaf0 Mon Sep 17 00:00:00 2001 From: Jakub Janarek Date: Tue, 24 Nov 2020 12:22:11 +0000 Subject: [PATCH 2/9] bump up version, add heidipay as author --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index c5949bca..fcb03066 100755 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ long_description = f.read() setup(name='django-datatable-view', - version='0.9.0', + version='0.9.1', description='This package is used in conjunction with the jQuery plugin ' '(http://http://datatables.net/), and supports state-saving detection' ' with (http://datatables.net/plug-ins/api). The package consists of ' @@ -15,7 +15,7 @@ ' table data from models.', long_description=long_description, long_description_content_type='text/markdown', - author='Autumn Valenta', + author='Autumn Valenta, HeidiPay Ltd.', author_email='avalenta@pivotalenergysolutions.com', url='https://github.com/pivotal-energy-solutions/django-datatable-view', download_url='https://github.com/pivotal-energy-solutions/django-datatable-view/tarball/django-datatable-view-0.9.0', From 18fcb40be693fc559a73bae33624464ef2e2dfa9 Mon Sep 17 00:00:00 2001 From: Jakub Janarek Date: Tue, 24 Nov 2020 12:40:41 +0000 Subject: [PATCH 3/9] amend setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fcb03066..7e59a7ff 100755 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ ' table data from models.', long_description=long_description, long_description_content_type='text/markdown', - author='Autumn Valenta, HeidiPay Ltd.', + author='Autumn Valenta', author_email='avalenta@pivotalenergysolutions.com', url='https://github.com/pivotal-energy-solutions/django-datatable-view', download_url='https://github.com/pivotal-energy-solutions/django-datatable-view/tarball/django-datatable-view-0.9.0', From 1173b61062badd019b06d2c79ee02ec3433e045f Mon Sep 17 00:00:00 2001 From: Jakub Janarek Date: Wed, 25 Nov 2020 14:08:05 +0000 Subject: [PATCH 4/9] bump up the version in __init__ --- datatableview/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datatableview/__init__.py b/datatableview/__init__.py index b8348d88..d27c7543 100644 --- a/datatableview/__init__.py +++ b/datatableview/__init__.py @@ -7,7 +7,7 @@ __name__ = 'datatableview' __author__ = 'Autumn Valenta' -__version_info__ = (0, 9, 0) +__version_info__ = (0, 9, 1) __version__ = '.'.join(map(str, __version_info__)) __date__ = '2013/11/14 2:00:00 PM' __credits__ = ['Autumn Valenta', 'Steven Klass'] From a07ff586bb27fa8ec5aad971da5715d575b1a419 Mon Sep 17 00:00:00 2001 From: Jakub Janarek <72017832+heidi-jakub@users.noreply.github.com> Date: Tue, 1 Dec 2020 11:50:06 +0000 Subject: [PATCH 5/9] Update datatableview/columns.py Co-authored-by: Pi Delport --- datatableview/columns.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/datatableview/columns.py b/datatableview/columns.py index 587b42b3..3f01d5f5 100644 --- a/datatableview/columns.py +++ b/datatableview/columns.py @@ -11,10 +11,7 @@ import django from django.db import models from django.db.models import Model, Manager, Q -try: - from django.db.models.fields import FieldDoesNotExist -except ImportError: - from django.core.exceptions import FieldDoesNotExist +from django.core.exceptions import FieldDoesNotExist from django.core.exceptions import ObjectDoesNotExist from django.utils.encoding import smart_text from django.utils.safestring import mark_safe From 694db5e45dc06f3253e18f0d3de0272ab4577d16 Mon Sep 17 00:00:00 2001 From: Jakub Janarek <72017832+heidi-jakub@users.noreply.github.com> Date: Tue, 1 Dec 2020 11:50:13 +0000 Subject: [PATCH 6/9] Update datatableview/datatables.py Co-authored-by: Pi Delport --- datatableview/datatables.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/datatableview/datatables.py b/datatableview/datatables.py index 4251fee3..4978a2da 100644 --- a/datatableview/datatables.py +++ b/datatableview/datatables.py @@ -9,10 +9,7 @@ except ImportError: pass -try: - from django.db.models.fields import FieldDoesNotExist -except ImportError: - from django.core.exceptions import FieldDoesNotExist +from django.core.exceptions import FieldDoesNotExist from django.template.loader import render_to_string from django.db.models import QuerySet try: From c146b0b0e5ac5f40d7b2b0de9c3162e7f47209d1 Mon Sep 17 00:00:00 2001 From: Jakub Janarek <72017832+heidi-jakub@users.noreply.github.com> Date: Tue, 1 Dec 2020 11:50:20 +0000 Subject: [PATCH 7/9] Update datatableview/utils.py Co-authored-by: Pi Delport --- datatableview/utils.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/datatableview/utils.py b/datatableview/utils.py index 4a688611..f6d7304a 100644 --- a/datatableview/utils.py +++ b/datatableview/utils.py @@ -6,10 +6,7 @@ pass from django.db import models -try: - from django.db.models.fields import FieldDoesNotExist -except ImportError: - from django.core.exceptions import FieldDoesNotExist +from django.core.exceptions import FieldDoesNotExist from django.utils.text import smart_split @@ -112,4 +109,3 @@ def contains_plural_field(model, fields): def split_terms(s): return filter(None, map(lambda t: t.strip("'\" "), smart_split(s))) - From aa81cbc1fb27d42c4cc6290222ea9ef0597477f7 Mon Sep 17 00:00:00 2001 From: Jakub Janarek Date: Wed, 2 Dec 2020 18:23:55 +0000 Subject: [PATCH 8/9] simplify imports --- datatableview/columns.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/datatableview/columns.py b/datatableview/columns.py index 3f01d5f5..d9b7837a 100644 --- a/datatableview/columns.py +++ b/datatableview/columns.py @@ -11,8 +11,7 @@ import django from django.db import models from django.db.models import Model, Manager, Q -from django.core.exceptions import FieldDoesNotExist -from django.core.exceptions import ObjectDoesNotExist +from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist from django.utils.encoding import smart_text from django.utils.safestring import mark_safe try: From 64ec0caf5c7ce65b64fb32225ffee45a7ef5728b Mon Sep 17 00:00:00 2001 From: Jakub Janarek Date: Wed, 2 Dec 2020 18:24:50 +0000 Subject: [PATCH 9/9] remove unused 'import django' import --- datatableview/columns.py | 1 - datatableview/compat.py | 1 - 2 files changed, 2 deletions(-) diff --git a/datatableview/columns.py b/datatableview/columns.py index d9b7837a..2147d239 100644 --- a/datatableview/columns.py +++ b/datatableview/columns.py @@ -8,7 +8,6 @@ except ImportError: pass -import django from django.db import models from django.db.models import Model, Manager, Q from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist diff --git a/datatableview/compat.py b/datatableview/compat.py index 3c67aa82..d9fcb803 100644 --- a/datatableview/compat.py +++ b/datatableview/compat.py @@ -1,7 +1,6 @@ # -*- encoding: utf-8 -*- """ Backports of code left behind by new versions of Django. """ -import django from django.utils.html import escape try: from django.utils.encoding import escape_uri_path as django_escape_uri_path