aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2020-07-17 19:49:57 +0300
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2020-07-17 19:50:39 +0300
commitc899b77d691e80f8734fdd761a2e5d86daa1faba (patch)
tree3340e3ab18fce8253d8f7521aaf632b7e916ab87
parent0089909ec256f36205ce8f99a970a798e3e018c3 (diff)
community/py3-django-treebeard: compatibility with Django 3
-rw-r--r--community/py3-django-treebeard/0001-Signature-of-ChangeList-changed-in-Django-2.1.patch45
-rw-r--r--community/py3-django-treebeard/0002-add-user-to-rrequest-object.patch33
-rw-r--r--community/py3-django-treebeard/0003-refactor-all-occurences-of-ChangeList.patch206
-rw-r--r--community/py3-django-treebeard/0004-Update-README.rst.patch24
-rw-r--r--community/py3-django-treebeard/0005-Update-README.rst.patch25
-rw-r--r--community/py3-django-treebeard/0006-docs-Fix-simple-typo-proprt-property.patch37
-rw-r--r--community/py3-django-treebeard/0007-Fix-pytest-installation-instructions.patch32
-rw-r--r--community/py3-django-treebeard/0008-Travis-CI-Get-PostgreSQL-server-back-on-default-port.patch25
-rw-r--r--community/py3-django-treebeard/0009-AppVeyor-Get-list-of-tox-environments-back-in-sync-w.patch35
-rw-r--r--community/py3-django-treebeard/0010-tox.ini-Document-state-of-environment-dj22-mssql.patch26
-rw-r--r--community/py3-django-treebeard/0011-Declare-support-for-Django-3-and-drop-support-for-EO.patch936
-rw-r--r--community/py3-django-treebeard/APKBUILD29
12 files changed, 1450 insertions, 3 deletions
diff --git a/community/py3-django-treebeard/0001-Signature-of-ChangeList-changed-in-Django-2.1.patch b/community/py3-django-treebeard/0001-Signature-of-ChangeList-changed-in-Django-2.1.patch
new file mode 100644
index 00000000000..35fc77d76d3
--- /dev/null
+++ b/community/py3-django-treebeard/0001-Signature-of-ChangeList-changed-in-Django-2.1.patch
@@ -0,0 +1,45 @@
+From 50489e63a5f89f02945f5dd67168d16512a3d603 Mon Sep 17 00:00:00 2001
+From: Jacob Rief <jacob.rief@gmail.com>
+Date: Fri, 27 Dec 2019 16:56:55 +0100
+Subject: [PATCH 01/11] Signature of ChangeList changed in Django-2.1
+
+---
+ treebeard/tests/test_treebeard.py | 15 +++++++++++----
+ 1 file changed, 11 insertions(+), 4 deletions(-)
+
+diff --git a/treebeard/tests/test_treebeard.py b/treebeard/tests/test_treebeard.py
+index 9756db8..3185582 100644
+--- a/treebeard/tests/test_treebeard.py
++++ b/treebeard/tests/test_treebeard.py
+@@ -5,6 +5,7 @@ from __future__ import unicode_literals
+ import datetime
+ import os
+
++from django import VERSION as DJANGO_VERSION
+ from django.contrib.admin.sites import AdminSite
+ from django.contrib.admin.views.main import ChangeList
+ from django.contrib.auth.models import User
+@@ -2372,10 +2373,16 @@ class TestAdminTree(TestNonEmptyTree):
+ m = admin_class(model, site)
+ list_display = m.get_list_display(request)
+ list_display_links = m.get_list_display_links(request, list_display)
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m)
++ if DJANGO_VERSION < (2, 1):
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m)
++ else:
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m, None)
+ cl.formset = None
+ context = Context({'cl': cl,
+ 'request': request})
+--
+2.25.4
+
diff --git a/community/py3-django-treebeard/0002-add-user-to-rrequest-object.patch b/community/py3-django-treebeard/0002-add-user-to-rrequest-object.patch
new file mode 100644
index 00000000000..4aaf6ea621e
--- /dev/null
+++ b/community/py3-django-treebeard/0002-add-user-to-rrequest-object.patch
@@ -0,0 +1,33 @@
+From 56121dcab673c304c437334bb3b160dded3db725 Mon Sep 17 00:00:00 2001
+From: Jacob Rief <jacob.rief@gmail.com>
+Date: Fri, 27 Dec 2019 17:20:13 +0100
+Subject: [PATCH 02/11] add user to rrequest object
+
+---
+ treebeard/tests/test_treebeard.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/treebeard/tests/test_treebeard.py b/treebeard/tests/test_treebeard.py
+index 3185582..5fa2c99 100644
+--- a/treebeard/tests/test_treebeard.py
++++ b/treebeard/tests/test_treebeard.py
+@@ -8,7 +8,7 @@ import os
+ from django import VERSION as DJANGO_VERSION
+ from django.contrib.admin.sites import AdminSite
+ from django.contrib.admin.views.main import ChangeList
+-from django.contrib.auth.models import User
++from django.contrib.auth.models import User, AnonymousUser
+ from django.contrib.messages.storage.fallback import FallbackStorage
+ from django.db.models import Q
+ from django.template import Template, Context
+@@ -2367,6 +2367,7 @@ class TestAdminTree(TestNonEmptyTree):
+ """
+ model = model_without_proxy
+ request = RequestFactory().get('/admin/tree/')
++ request.user = AnonymousUser()
+ site = AdminSite()
+ form_class = movenodeform_factory(model)
+ admin_class = admin_factory(form_class)
+--
+2.25.4
+
diff --git a/community/py3-django-treebeard/0003-refactor-all-occurences-of-ChangeList.patch b/community/py3-django-treebeard/0003-refactor-all-occurences-of-ChangeList.patch
new file mode 100644
index 00000000000..37cd6a0e37f
--- /dev/null
+++ b/community/py3-django-treebeard/0003-refactor-all-occurences-of-ChangeList.patch
@@ -0,0 +1,206 @@
+From d6f117f0da2984bb6364ce2a3e1feea654362ab8 Mon Sep 17 00:00:00 2001
+From: Jacob Rief <jacob.rief@gmail.com>
+Date: Fri, 27 Dec 2019 17:40:10 +0100
+Subject: [PATCH 03/11] refactor all occurences of ChangeList
+
+---
+ treebeard/tests/test_treebeard.py | 105 ++++++++++++++++++++++--------
+ 1 file changed, 77 insertions(+), 28 deletions(-)
+
+diff --git a/treebeard/tests/test_treebeard.py b/treebeard/tests/test_treebeard.py
+index 5fa2c99..fbf86f3 100644
+--- a/treebeard/tests/test_treebeard.py
++++ b/treebeard/tests/test_treebeard.py
+@@ -2409,6 +2409,7 @@ class TestAdminTree(TestNonEmptyTree):
+ # Add a unicode description
+ model.add_root(desc='áéîøü')
+ request = RequestFactory().get('/admin/tree/')
++ request.user = AnonymousUser()
+ site = AdminSite()
+ form_class = movenodeform_factory(model)
+ ModelAdmin = admin_factory(form_class)
+@@ -2419,10 +2420,16 @@ class TestAdminTree(TestNonEmptyTree):
+ m = UnicodeModelAdmin(model, site)
+ list_display = m.get_list_display(request)
+ list_display_links = m.get_list_display_links(request, list_display)
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m)
++ if DJANGO_VERSION < (2, 1):
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m)
++ else:
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m, None)
+ cl.formset = None
+ context = Context({'cl': cl,
+ 'request': request})
+@@ -2445,16 +2452,23 @@ class TestAdminTree(TestNonEmptyTree):
+ model = model_without_proxy
+ # Filtered GET
+ request = RequestFactory().get('/admin/tree/?desc=1')
++ request.user = AnonymousUser()
+ site = AdminSite()
+ form_class = movenodeform_factory(model)
+ admin_class = admin_factory(form_class)
+ m = admin_class(model, site)
+ list_display = m.get_list_display(request)
+ list_display_links = m.get_list_display_links(request, list_display)
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m)
++ if DJANGO_VERSION < (2, 1):
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m)
++ else:
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m, None)
+ cl.formset = None
+ context = Context({'cl': cl,
+ 'request': request})
+@@ -2465,12 +2479,19 @@ class TestAdminTree(TestNonEmptyTree):
+
+ # Not Filtered GET, it should ignore pagination
+ request = RequestFactory().get('/admin/tree/?p=1')
++ request.user = AnonymousUser()
+ list_display = m.get_list_display(request)
+ list_display_links = m.get_list_display_links(request, list_display)
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m)
++ if DJANGO_VERSION < (2, 1):
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m)
++ else:
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m, None)
+ cl.formset = None
+ context = Context({'cl': cl,
+ 'request': request})
+@@ -2481,12 +2502,19 @@ class TestAdminTree(TestNonEmptyTree):
+
+ # Not Filtered GET, it should ignore all
+ request = RequestFactory().get('/admin/tree/?all=1')
++ request.user = AnonymousUser()
+ list_display = m.get_list_display(request)
+ list_display_links = m.get_list_display_links(request, list_display)
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m)
++ if DJANGO_VERSION < (2, 1):
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m)
++ else:
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m, None)
+ cl.formset = None
+ context = Context({'cl': cl,
+ 'request': request})
+@@ -2507,16 +2535,23 @@ class TestAdminTreeList(TestNonEmptyTree):
+ """
+ model = model_without_proxy
+ request = RequestFactory().get('/admin/tree/')
++ request.user = AnonymousUser()
+ site = AdminSite()
+ form_class = movenodeform_factory(model)
+ admin_class = admin_factory(form_class)
+ m = admin_class(model, site)
+ list_display = m.get_list_display(request)
+ list_display_links = m.get_list_display_links(request, list_display)
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m)
++ if DJANGO_VERSION < (2, 1):
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m)
++ else:
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m, None)
+ cl.formset = None
+ context = Context({'cl': cl,
+ 'request': request})
+@@ -2530,16 +2565,23 @@ class TestAdminTreeList(TestNonEmptyTree):
+ def test_result_tree_list_with_action(self, model_without_proxy):
+ model = model_without_proxy
+ request = RequestFactory().get('/admin/tree/')
++ request.user = AnonymousUser()
+ site = AdminSite()
+ form_class = movenodeform_factory(model)
+ admin_class = admin_factory(form_class)
+ m = admin_class(model, site)
+ list_display = m.get_list_display(request)
+ list_display_links = m.get_list_display_links(request, list_display)
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m)
++ if DJANGO_VERSION < (2, 1):
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m)
++ else:
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m, None)
+ cl.formset = None
+ context = Context({'cl': cl,
+ 'request': request,
+@@ -2559,6 +2601,7 @@ class TestAdminTreeList(TestNonEmptyTree):
+ # Test t GET parameter with value id
+ request = RequestFactory().get(
+ '/admin/tree/?{0}=id'.format(TO_FIELD_VAR))
++ request.user = AnonymousUser()
+ site = AdminSite()
+ admin_register_all(site)
+ form_class = movenodeform_factory(model)
+@@ -2566,10 +2609,16 @@ class TestAdminTreeList(TestNonEmptyTree):
+ m = admin_class(model, site)
+ list_display = m.get_list_display(request)
+ list_display_links = m.get_list_display_links(request, list_display)
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m)
++ if DJANGO_VERSION < (2, 1):
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m)
++ else:
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m, None)
+ cl.formset = None
+ context = Context({'cl': cl,
+ 'request': request})
+--
+2.25.4
+
diff --git a/community/py3-django-treebeard/0004-Update-README.rst.patch b/community/py3-django-treebeard/0004-Update-README.rst.patch
new file mode 100644
index 00000000000..f07f7f5a958
--- /dev/null
+++ b/community/py3-django-treebeard/0004-Update-README.rst.patch
@@ -0,0 +1,24 @@
+From 05c65b790a0054a9083518a039ed68a84bb44e56 Mon Sep 17 00:00:00 2001
+From: Jacob Rief <jacob.rief@gmail.com>
+Date: Fri, 27 Dec 2019 18:44:00 +0100
+Subject: [PATCH 04/11] Update README.rst
+
+---
+ README.rst | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/README.rst b/README.rst
+index 3e4219e..037df1a 100644
+--- a/README.rst
++++ b/README.rst
+@@ -50,6 +50,6 @@ Supported versions
+
+ **django-treebeard** officially supports
+
+-* Django 1.8 - 2.0
++* Django 1.11 - 2.2
+ * Python 2.7, 3.4, 3.5, 3.6
+ * PostgreSQL, MySQL, SQLite database back-ends.
+--
+2.25.4
+
diff --git a/community/py3-django-treebeard/0005-Update-README.rst.patch b/community/py3-django-treebeard/0005-Update-README.rst.patch
new file mode 100644
index 00000000000..f86ff48f723
--- /dev/null
+++ b/community/py3-django-treebeard/0005-Update-README.rst.patch
@@ -0,0 +1,25 @@
+From 2c14a9a564cc6efc59128012aa5fc650a86a650e Mon Sep 17 00:00:00 2001
+From: Jacob Rief <jacob.rief@gmail.com>
+Date: Fri, 27 Dec 2019 18:44:26 +0100
+Subject: [PATCH 05/11] Update README.rst
+
+---
+ README.rst | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/README.rst b/README.rst
+index 037df1a..62abe1a 100644
+--- a/README.rst
++++ b/README.rst
+@@ -3,7 +3,7 @@ django-treebeard
+ ================
+
+ **django-treebeard** is a library that implements efficient tree implementations
+-for the Django Web Framework 1.8 and later.
++for the Django Web Framework 1.11 and later.
+
+ It is written by Gustavo Picón and licensed under the Apache License 2.0.
+
+--
+2.25.4
+
diff --git a/community/py3-django-treebeard/0006-docs-Fix-simple-typo-proprt-property.patch b/community/py3-django-treebeard/0006-docs-Fix-simple-typo-proprt-property.patch
new file mode 100644
index 00000000000..2a8a014d9ee
--- /dev/null
+++ b/community/py3-django-treebeard/0006-docs-Fix-simple-typo-proprt-property.patch
@@ -0,0 +1,37 @@
+From 85c48ea3303d0ffe0afb74c033dd06373aad57f2 Mon Sep 17 00:00:00 2001
+From: Tim Gates <tim.gates@iress.com>
+Date: Mon, 9 Mar 2020 18:02:53 +1100
+Subject: [PATCH 06/11] docs: Fix simple typo, proprt -> property
+
+There is a small typo in treebeard/static/treebeard/treebeard-admin.js.
+
+Should read `property` rather than `proprt`.
+---
+ treebeard/static/treebeard/treebeard-admin.js | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/treebeard/static/treebeard/treebeard-admin.js b/treebeard/static/treebeard/treebeard-admin.js
+index b8daa6b..13c2f4c 100644
+--- a/treebeard/static/treebeard/treebeard-admin.js
++++ b/treebeard/static/treebeard/treebeard-admin.js
+@@ -41,7 +41,7 @@
+ var node = new Node(this);
+ node.collapse();
+ }).hide();
+- // Swicth class to set the proprt expand/collapse icon
++ // Swicth class to set the property expand/collapse icon
+ $elem.find('a.collapse').removeClass('expanded').addClass('collapsed');
+ },
+ parent_node: function () {
+@@ -51,7 +51,7 @@
+ expand: function () {
+ // Display each kid (will display in collapsed state)
+ this.children().show();
+- // Swicth class to set the proprt expand/collapse icon
++ // Swicth class to set the property expand/collapse icon
+ $elem.find('a.collapse').removeClass('collapsed').addClass('expanded');
+
+ },
+--
+2.25.4
+
diff --git a/community/py3-django-treebeard/0007-Fix-pytest-installation-instructions.patch b/community/py3-django-treebeard/0007-Fix-pytest-installation-instructions.patch
new file mode 100644
index 00000000000..8b1fae1eab1
--- /dev/null
+++ b/community/py3-django-treebeard/0007-Fix-pytest-installation-instructions.patch
@@ -0,0 +1,32 @@
+From a602f7364666fd44e0846c606ff0fe64bc3f84c7 Mon Sep 17 00:00:00 2001
+From: Matt Westcott <matt@west.co.tt>
+Date: Fri, 26 Jun 2020 15:13:15 +0100
+Subject: [PATCH 07/11] Fix pytest installation instructions
+
+Since the removal of requirements_test.txt (in 2a0e8fb756d7c9dfce5f66e2b3cf68274dbc96d5 and 63610e0fd83d2fbb4126963bbe22b5b0a76f6104) it is no longer the case that `pip install -r requirements.txt` will install pytest.
+---
+ docs/source/tests.rst | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/docs/source/tests.rst b/docs/source/tests.rst
+index 2218bed..f75d11e 100644
+--- a/docs/source/tests.rst
++++ b/docs/source/tests.rst
+@@ -7,12 +7,11 @@ recommended that you run and update the test suite when you send patches.
+ py.test
+ -------
+
+-You will need `pytest`_ to run the test suite. It's included with the
+-development dependencies:
++You will need `pytest`_ to run the test suite:
+
+ .. code-block:: console
+
+- $ pip install -r requirements.txt
++ $ pip install pytest
+
+ Then just run the test suite:
+
+--
+2.25.4
+
diff --git a/community/py3-django-treebeard/0008-Travis-CI-Get-PostgreSQL-server-back-on-default-port.patch b/community/py3-django-treebeard/0008-Travis-CI-Get-PostgreSQL-server-back-on-default-port.patch
new file mode 100644
index 00000000000..b7056095770
--- /dev/null
+++ b/community/py3-django-treebeard/0008-Travis-CI-Get-PostgreSQL-server-back-on-default-port.patch
@@ -0,0 +1,25 @@
+From 6ecadb26fb416a2953b9d9810d77e249448befa8 Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Thu, 2 Jul 2020 00:09:33 +0200
+Subject: [PATCH 08/11] Travis CI: Get PostgreSQL server back on default port
+ 5432
+
+---
+ .travis.yml | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/.travis.yml b/.travis.yml
+index 2dfb198..4c7fe65 100644
+--- a/.travis.yml
++++ b/.travis.yml
+@@ -110,6 +110,7 @@ before_install:
+ - sudo apt-get --yes remove postgresql\*
+ - sudo apt-get install -y postgresql-11 postgresql-client-11
+ - sudo cp /etc/postgresql/{9.6,11}/main/pg_hba.conf
++ - sudo sed 's,port = 5433,port = 5432,' -i /etc/postgresql/11/main/postgresql.conf
+ - sudo service postgresql restart 11
+
+ install:
+--
+2.25.4
+
diff --git a/community/py3-django-treebeard/0009-AppVeyor-Get-list-of-tox-environments-back-in-sync-w.patch b/community/py3-django-treebeard/0009-AppVeyor-Get-list-of-tox-environments-back-in-sync-w.patch
new file mode 100644
index 00000000000..9adcc265458
--- /dev/null
+++ b/community/py3-django-treebeard/0009-AppVeyor-Get-list-of-tox-environments-back-in-sync-w.patch
@@ -0,0 +1,35 @@
+From 6616bf5b14d3479946a8557ab4226ab4f55fbb47 Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Thu, 2 Jul 2020 00:18:54 +0200
+Subject: [PATCH 09/11] AppVeyor: Get list of tox environments back in sync
+ with tox.ini
+
+In detail:
+- drop tox environments that do not currently exist in tox.ini
+- cover Django 2.0 and 2.1 as well
+---
+ appveyor.yml | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/appveyor.yml b/appveyor.yml
+index 84b5734..0514065 100644
+--- a/appveyor.yml
++++ b/appveyor.yml
+@@ -3,12 +3,9 @@ services:
+
+ environment:
+ matrix:
+- - TOXENV: py27-dj18-mssql
+- - TOXENV: py27-dj19-mssql
+- - TOXENV: py27-dj110-mssql
+- - TOXENV: py35-dj19-mssql
+- - TOXENV: py36-dj110-mssql
+ - TOXENV: py36-dj111-mssql
++ - TOXENV: py36-dj20-mssql
++ - TOXENV: py36-dj21-mssql
+
+ matrix:
+ fast_finish: true
+--
+2.25.4
+
diff --git a/community/py3-django-treebeard/0010-tox.ini-Document-state-of-environment-dj22-mssql.patch b/community/py3-django-treebeard/0010-tox.ini-Document-state-of-environment-dj22-mssql.patch
new file mode 100644
index 00000000000..ae8a83e3bbc
--- /dev/null
+++ b/community/py3-django-treebeard/0010-tox.ini-Document-state-of-environment-dj22-mssql.patch
@@ -0,0 +1,26 @@
+From d28870061d60b609ecab9c9eb5968eee21db46cf Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Thu, 2 Jul 2020 00:45:52 +0200
+Subject: [PATCH 10/11] tox.ini: Document state of environment *-dj22-mssql
+
+---
+ tox.ini | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/tox.ini b/tox.ini
+index 48de565..777fae6 100644
+--- a/tox.ini
++++ b/tox.ini
+@@ -5,6 +5,9 @@
+ #
+
+ [tox]
++# mssql: Note that django-pyodbc-azure 2.1.0.0 does not support Django 2.2,
++# see https://github.com/michiya/django-pyodbc-azure/issues/192 ;
++# as a result, environments *-dj22-mssql are not actually usable.
+ envlist =
+ {py27,py35,py36,py37}-{dj111,dj20,dj21,dj22}-{sqlite,postgres,mysql,mssql}
+
+--
+2.25.4
+
diff --git a/community/py3-django-treebeard/0011-Declare-support-for-Django-3-and-drop-support-for-EO.patch b/community/py3-django-treebeard/0011-Declare-support-for-Django-3-and-drop-support-for-EO.patch
new file mode 100644
index 00000000000..540277928f9
--- /dev/null
+++ b/community/py3-django-treebeard/0011-Declare-support-for-Django-3-and-drop-support-for-EO.patch
@@ -0,0 +1,936 @@
+From 7ea2fef9675e8d2f2dab09eeeb2f24d958f7cb4c Mon Sep 17 00:00:00 2001
+From: Samir Shah <solaris.smoke@gmail.com>
+Date: Mon, 6 Jul 2020 07:38:27 +0300
+Subject: [PATCH 11/11] Declare support for Django 3 and drop support for EOL
+ Django versions.
+
+---
+ .travis.yml | 96 +++++++---------------
+ README.rst | 4 +-
+ appveyor.yml | 9 ++-
+ docs/source/install.rst | 4 +-
+ docs/source/tests.rst | 21 ++---
+ docs/source/tutorial.rst | 5 --
+ setup.cfg | 3 -
+ setup.py | 15 ++--
+ tox.ini | 12 +--
+ treebeard/__init__.py | 1 -
+ treebeard/admin.py | 50 ++++--------
+ treebeard/al_tree.py | 2 +-
+ treebeard/forms.py | 2 +-
+ treebeard/models.py | 17 ++--
+ treebeard/mp_tree.py | 6 +-
+ treebeard/ns_tree.py | 7 +-
+ treebeard/templatetags/admin_tree.py | 69 ++++------------
+ treebeard/tests/settings.py | 19 +----
+ treebeard/tests/test_treebeard.py | 114 ++++++++-------------------
+ 19 files changed, 129 insertions(+), 327 deletions(-)
+
+diff --git a/.travis.yml b/.travis.yml
+index 4c7fe65..5200466 100644
+--- a/.travis.yml
++++ b/.travis.yml
+@@ -13,75 +13,6 @@ addons:
+
+ matrix:
+ include:
+- #
+- # Django 1.11
+- - python: 2.7
+- env: TOXENV=py27-dj111-sqlite
+- - python: 3.5
+- env: TOXENV=py35-dj111-sqlite
+- - python: 3.6
+- env: TOXENV=py36-dj111-sqlite
+-
+- - python: 2.7
+- env: TOXENV=py27-dj111-postgres
+- - python: 3.5
+- env: TOXENV=py35-dj111-postgres
+- - python: 3.6
+- env: TOXENV=py36-dj111-postgres
+-
+- - python: 2.7
+- env: TOXENV=py27-dj111-mysql
+- - python: 3.5
+- env: TOXENV=py35-dj111-mysql
+- - python: 3.6
+- env: TOXENV=py36-dj111-mysql
+-
+- #
+- # Django 2.0
+- - python: 3.5
+- env: TOXENV=py35-dj20-sqlite
+- - python: 3.6
+- env: TOXENV=py36-dj20-sqlite
+- - python: 3.7
+- env: TOXENV=py37-dj20-sqlite
+-
+- - python: 3.5
+- env: TOXENV=py35-dj20-postgres
+- - python: 3.6
+- env: TOXENV=py36-dj20-postgres
+- - python: 3.7
+- env: TOXENV=py37-dj20-postgres
+-
+- - python: 3.5
+- env: TOXENV=py35-dj20-mysql
+- - python: 3.6
+- env: TOXENV=py36-dj20-mysql
+- - python: 3.7
+- env: TOXENV=py37-dj20-mysql
+-
+- #
+- # Django 2.1
+- - python: 3.5
+- env: TOXENV=py35-dj21-sqlite
+- - python: 3.6
+- env: TOXENV=py36-dj21-sqlite
+- - python: 3.7
+- env: TOXENV=py37-dj21-sqlite
+-
+- - python: 3.5
+- env: TOXENV=py35-dj21-postgres
+- - python: 3.6
+- env: TOXENV=py36-dj21-postgres
+- - python: 3.7
+- env: TOXENV=py37-dj21-postgres
+-
+- - python: 3.5
+- env: TOXENV=py35-dj21-mysql
+- - python: 3.6
+- env: TOXENV=py36-dj21-mysql
+- - python: 3.7
+- env: TOXENV=py37-dj21-mysql
+-
+ #
+ # Django 2.2
+ - python: 3.5
+@@ -97,6 +28,8 @@ matrix:
+ env: TOXENV=py36-dj22-postgres
+ - python: 3.7
+ env: TOXENV=py37-dj22-postgres
++ - python: 3.8
++ env: TOXENV=py38-dj22-postgres
+
+ - python: 3.5
+ env: TOXENV=py35-dj22-mysql
+@@ -104,6 +37,31 @@ matrix:
+ env: TOXENV=py36-dj22-mysql
+ - python: 3.7
+ env: TOXENV=py37-dj22-mysql
++ - python: 3.8
++ env: TOXENV=py38-dj22-mysql
++
++ #
++ # Django 3.0
++ - python: 3.6
++ env: TOXENV=py36-dj30-sqlite
++ - python: 3.7
++ env: TOXENV=py37-dj30-sqlite
++ - python: 3.8
++ env: TOXENV=py38-dj30-sqlite
++
++ - python: 3.6
++ env: TOXENV=py36-dj30-postgres
++ - python: 3.7
++ env: TOXENV=py37-dj30-postgres
++ - python: 3.8
++ env: TOXENV=py38-dj30-postgres
++
++ - python: 3.6
++ env: TOXENV=py36-dj30-mysql
++ - python: 3.7
++ env: TOXENV=py37-dj30-mysql
++ - python: 3.8
++ env: TOXENV=py38-dj30-mysql
+
+ before_install:
+ - sudo apt-get update
+diff --git a/README.rst b/README.rst
+index 62abe1a..97551ca 100644
+--- a/README.rst
++++ b/README.rst
+@@ -50,6 +50,6 @@ Supported versions
+
+ **django-treebeard** officially supports
+
+-* Django 1.11 - 2.2
+-* Python 2.7, 3.4, 3.5, 3.6
++* Django 2.2 - 3.0
++* Python 3.5, 3.6, 3.7, 3.8
+ * PostgreSQL, MySQL, SQLite database back-ends.
+diff --git a/appveyor.yml b/appveyor.yml
+index 0514065..6f92122 100644
+--- a/appveyor.yml
++++ b/appveyor.yml
+@@ -3,9 +3,12 @@ services:
+
+ environment:
+ matrix:
+- - TOXENV: py36-dj111-mssql
+- - TOXENV: py36-dj20-mssql
+- - TOXENV: py36-dj21-mssql
++ - TOXENV: py36-dj22-mssql
++ - TOXENV: py37-dj22-mssql
++ - TOXENV: py38-dj22-mssql
++ - TOXENV: py36-dj30-mssql
++ - TOXENV: py37-dj30-mssql
++ - TOXENV: py38-dj30-mssql
+
+ matrix:
+ fast_finish: true
+diff --git a/docs/source/install.rst b/docs/source/install.rst
+index 1c579fd..1e6790c 100644
+--- a/docs/source/install.rst
++++ b/docs/source/install.rst
+@@ -5,8 +5,7 @@ Installation
+ Prerequisites
+ -------------
+
+-``django-treebeard`` needs at least **Python 2.7/3.4** to run, and
+-**Django 1.8 or later**.
++``django-treebeard`` needs at least **Python 3.5** to run, and **Django 2.2 or later**.
+
+
+ Installing
+@@ -84,4 +83,3 @@ settings file.
+
+ .. _`django-treebeard's PyPI page`:
+ https://pypi.org/project/django-treebeard/
+-
+diff --git a/docs/source/tests.rst b/docs/source/tests.rst
+index f75d11e..f564041 100644
+--- a/docs/source/tests.rst
++++ b/docs/source/tests.rst
+@@ -39,20 +39,13 @@ tox
+ ---
+
+ ``django-treebeard`` uses `tox`_ to run the test suite in all the supported
+-environments:
+-
+- - py27-dj16-sqlite
+- - py27-dj16-mysql
+- - py27-dj16-pgsql
+- - py27-dj17-sqlite
+- - py27-dj17-mysql
+- - py27-dj17-pgsql
+- - py34-dj16-sqlite
+- - py34-dj16-pgsql
+- - py34-dj17-sqlite
+- - py34-dj17-pgsql
+-
+-This means that the test suite will run 10 times to test every
++environments - permutations of:
++
++ - Python 3.5, 3.6, 3.7 and 3.8
++ - Django 2.2 and 3.0
++ - Sqlite, MySQL and PostgreSQL
++
++This means that the test suite will run 24 times to test every
+ environment supported by ``django-treebeard``. This takes a long time.
+ If you want to test only one or a few environments, please use the `-e`
+ option in `tox`_, like:
+diff --git a/docs/source/tutorial.rst b/docs/source/tutorial.rst
+index 1af5adc..cb5a1aa 100644
+--- a/docs/source/tutorial.rst
++++ b/docs/source/tutorial.rst
+@@ -6,11 +6,9 @@ Create a basic model for your tree. In this example we'll use a Materialized Pat
+ .. code-block:: python
+
+ from django.db import models
+- from django.utils.encoding import python_2_unicode_compatible
+
+ from treebeard.mp_tree import MP_Node
+
+- @python_2_unicode_compatible
+ class Category(MP_Node):
+ name = models.CharField(max_length=30)
+
+@@ -19,9 +17,6 @@ Create a basic model for your tree. In this example we'll use a Materialized Pat
+ def __str__(self):
+ return 'Category: {}'.format(self.name)
+
+-This example works on Python 3 as well as on Python 2. If you don't need Python 2 support
+-remove the ``@python_2_unicode_compatible`` decorator.
+-
+
+ Run syncdb:
+
+diff --git a/setup.cfg b/setup.cfg
+index ed8a958..0c9e0fc 100644
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -1,5 +1,2 @@
+-[bdist_wheel]
+-universal = 1
+-
+ [metadata]
+ license_file = LICENSE
+diff --git a/setup.py b/setup.py
+index 550f28e..aa70a38 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1,7 +1,5 @@
+ #!/usr/bin/env python
+ # -*- coding: utf-8 -*-
+-from __future__ import unicode_literals
+-
+ import os
+ from setuptools import setup, find_packages
+ from treebeard import __version__
+@@ -26,7 +24,7 @@ setup_args = dict(
+ include_package_data=True,
+ description='Efficient tree implementations for Django',
+ long_description=codecs.open(os.path.join(root_dir(), 'README.rst'), encoding='utf-8').read(),
+- install_requires=['Django>=1.8'],
++ install_requires=['Django>=2.2'],
+ tests_require=['pytest'],
+ classifiers=[
+ 'Development Status :: 5 - Production/Stable',
+@@ -34,16 +32,13 @@ setup_args = dict(
+ 'License :: OSI Approved :: Apache Software License',
+ 'Environment :: Web Environment',
+ 'Framework :: Django',
+- 'Framework :: Django :: 1.8',
+- 'Framework :: Django :: 1.9',
+- 'Framework :: Django :: 1.10',
+- 'Framework :: Django :: 1.11',
+- 'Framework :: Django :: 2.0',
++ 'Framework :: Django :: 2.2',
++ 'Framework :: Django :: 3.0',
+ 'Programming Language :: Python',
+- 'Programming Language :: Python :: 2.7',
+- 'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
++ 'Programming Language :: Python :: 3.7',
++ 'Programming Language :: Python :: 3.8',
+ 'Operating System :: OS Independent',
+ 'Topic :: Software Development :: Libraries',
+ 'Topic :: Utilities'])
+diff --git a/tox.ini b/tox.ini
+index 777fae6..8b2e8ab 100644
+--- a/tox.ini
++++ b/tox.ini
+@@ -9,7 +9,7 @@
+ # see https://github.com/michiya/django-pyodbc-azure/issues/192 ;
+ # as a result, environments *-dj22-mssql are not actually usable.
+ envlist =
+- {py27,py35,py36,py37}-{dj111,dj20,dj21,dj22}-{sqlite,postgres,mysql,mssql}
++ {py35,py36,py37,py38}-{dj22,dj30}-{sqlite,postgres,mysql,mssql}
+
+ [testenv:docs]
+ basepython = python
+@@ -23,18 +23,14 @@ commands =
+ [testenv]
+ deps =
+ pytest>=3.0
+- dj111: Django>=1.11,<2.0
+- dj20: Django>=2.0,<2.1
+- dj21: Django>=2.1,<2.2
+ dj22: Django>=2.2,<3.0
++ dj30: Django>=3.0,<3.1
+ postgres: psycopg2>=2.6
+ mysql: mysqlclient>=1.3.9
+- dj111-mssql: django-pyodbc-azure==1.11.15.0
+- dj20-mssql: django-pyodbc-azure==2.0.8.0
+- dj21-mssql: django-pyodbc-azure==2.1.0.0
+ dj22-mssql: django-pyodbc-azure==2.1.0.0
++ dj30-mssql: django-pyodbc-azure==2.1.0.0
+
+-setenv =
++setenv =
+ sqlite: DATABASE_ENGINE=sqlite
+ postgres: DATABASE_ENGINE=psql
+ mysql: DATABASE_ENGINE=mysql
+diff --git a/treebeard/__init__.py b/treebeard/__init__.py
+index c1f4801..00d37f5 100644
+--- a/treebeard/__init__.py
++++ b/treebeard/__init__.py
+@@ -1,5 +1,4 @@
+ # -*- coding: utf-8 -*-
+-from __future__ import unicode_literals
+ """
+ See PEP 386 (https://www.python.org/dev/peps/pep-0386/)
+
+diff --git a/treebeard/admin.py b/treebeard/admin.py
+index 4511d57..6737c67 100644
+--- a/treebeard/admin.py
++++ b/treebeard/admin.py
+@@ -2,30 +2,20 @@
+
+ import sys
+
+-import django
+-
+ from django.conf import settings
+ from django.conf.urls import url
+
+ from django.contrib import admin, messages
++from django.contrib.admin.options import TO_FIELD_VAR
+ from django.http import HttpResponse, HttpResponseBadRequest
+-from django.utils.translation import ugettext_lazy as _
+-if sys.version_info >= (3, 0):
+- from django.utils.encoding import force_str
+-else:
+- from django.utils.encoding import force_unicode as force_str
++from django.utils.translation import gettext_lazy as _
++from django.utils.encoding import force_str
+
+ from treebeard.exceptions import (InvalidPosition, MissingNodeOrderBy,
+ InvalidMoveToDescendant, PathOverflow)
+ from treebeard.al_tree import AL_Node
+
+
+-try:
+- from django.contrib.admin.options import TO_FIELD_VAR
+-except ImportError:
+- from django.contrib.admin.views.main import TO_FIELD_VAR
+-
+-
+ class TreeAdmin(admin.ModelAdmin):
+ """Django Admin class for treebeard."""
+
+@@ -46,18 +36,15 @@ class TreeAdmin(admin.ModelAdmin):
+ self.change_list_template = 'admin/tree_list.html'
+ if extra_context is None:
+ extra_context = {}
+- if django.VERSION < (1, 10):
+- request_context = 'django.core.context_processors.request' in settings.TEMPLATE_CONTEXT_PROCESSORS
+- else:
+- request_context = any(
+- map(
+- lambda tmpl:
+- tmpl.get('BACKEND', None) == 'django.template.backends.django.DjangoTemplates' and
+- tmpl.get('APP_DIRS', False) and
+- 'django.template.context_processors.request' in tmpl.get('OPTIONS', {}).get('context_processors', []),
+- settings.TEMPLATES
+- )
++ request_context = any(
++ map(
++ lambda tmpl:
++ tmpl.get('BACKEND', None) == 'django.template.backends.django.DjangoTemplates' and
++ tmpl.get('APP_DIRS', False) and
++ 'django.template.context_processors.request' in tmpl.get('OPTIONS', {}).get('context_processors', []),
++ settings.TEMPLATES
+ )
++ )
+ lacks_request = ('request' not in extra_context and not request_context)
+ if lacks_request:
+ extra_context['request'] = request
+@@ -68,17 +55,12 @@ class TreeAdmin(admin.ModelAdmin):
+ Adds a url to move nodes to this admin
+ """
+ urls = super(TreeAdmin, self).get_urls()
++ from django.views.i18n import JavaScriptCatalog
+
+- if django.VERSION < (1, 10):
+- from django.views.i18n import javascript_catalog
+- jsi18n_url = url(r'^jsi18n/$', javascript_catalog, {'packages': ('treebeard',)})
+- else:
+- from django.views.i18n import JavaScriptCatalog
+-
+- jsi18n_url = url(r'^jsi18n/$',
+- JavaScriptCatalog.as_view(packages=['treebeard']),
+- name='javascript-catalog'
+- )
++ jsi18n_url = url(r'^jsi18n/$',
++ JavaScriptCatalog.as_view(packages=['treebeard']),
++ name='javascript-catalog'
++ )
+
+ new_urls = [
+ url('^move/$', self.admin_site.admin_view(self.move_node), ),
+diff --git a/treebeard/al_tree.py b/treebeard/al_tree.py
+index c9b9ee5..8ac408a 100644
+--- a/treebeard/al_tree.py
++++ b/treebeard/al_tree.py
+@@ -2,7 +2,7 @@
+
+ from django.core import serializers
+ from django.db import models, transaction
+-from django.utils.translation import ugettext_noop as _
++from django.utils.translation import gettext_noop as _
+ from treebeard.exceptions import InvalidMoveToDescendant, NodeAlreadySaved
+ from treebeard.models import Node
+
+diff --git a/treebeard/forms.py b/treebeard/forms.py
+index ddd6c82..98c7289 100644
+--- a/treebeard/forms.py
++++ b/treebeard/forms.py
+@@ -6,7 +6,7 @@ from django.forms.models import BaseModelForm, ErrorList, model_to_dict
+ from django.forms.models import modelform_factory as django_modelform_factory
+ from django.utils.html import escape
+ from django.utils.safestring import mark_safe
+-from django.utils.translation import ugettext_lazy as _
++from django.utils.translation import gettext_lazy as _
+
+ from treebeard.al_tree import AL_Node
+ from treebeard.mp_tree import MP_Node
+diff --git a/treebeard/models.py b/treebeard/models.py
+index 8db6211..01f790c 100644
+--- a/treebeard/models.py
++++ b/treebeard/models.py
+@@ -1,12 +1,8 @@
+ """Models and base API"""
+
+-import sys
+ import operator
++from functools import reduce
+
+-if sys.version_info >= (3, 0):
+- from functools import reduce
+-
+-import django
+ from django.db.models import Q
+ from django.db import models, transaction, router, connections
+
+@@ -26,7 +22,7 @@ class Node(models.Model):
+ position, use :meth:`add_sibling` in an already existing root node
+ instead.
+
+- :param \*\*kwargs: object creation data that will be passed to the
++ :param `**kwargs`: object creation data that will be passed to the
+ inherited Node model
+ :param instance: Instead of passing object creation data, you can
+ pass an already-constructed (but not yet saved) model instance to
+@@ -50,10 +46,7 @@ class Node(models.Model):
+ field.get_internal_type() == 'ForeignKey' and
+ field.name != 'parent'
+ ):
+- if django.VERSION >= (1, 9):
+- foreign_keys[field.name] = field.remote_field.model
+- else:
+- foreign_keys[field.name] = field.rel.to
++ foreign_keys[field.name] = field.remote_field.model
+ return foreign_keys
+
+ @classmethod
+@@ -368,7 +361,7 @@ class Node(models.Model):
+ use the :meth:`add_sibling` method of an already existing
+ child node instead.
+
+- :param \*\*kwargs:
++ :param `**kwargs`:
+
+ Object creation data that will be passed to the inherited Node
+ model
+@@ -400,7 +393,7 @@ class Node(models.Model):
+ - ``sorted-sibling``: the new node will be at the right position
+ according to the value of node_order_by
+
+- :param \*\*kwargs:
++ :param `**kwargs`:
+
+ Object creation data that will be passed to the inherited
+ Node model
+diff --git a/treebeard/mp_tree.py b/treebeard/mp_tree.py
+index 7ec9e43..0c2a068 100644
+--- a/treebeard/mp_tree.py
++++ b/treebeard/mp_tree.py
+@@ -2,14 +2,12 @@
+
+ import sys
+ import operator
+-
+-if sys.version_info >= (3, 0):
+- from functools import reduce
++from functools import reduce
+
+ from django.core import serializers
+ from django.db import models, transaction, connection
+ from django.db.models import F, Q
+-from django.utils.translation import ugettext_noop as _
++from django.utils.translation import gettext_noop as _
+
+ from treebeard.numconv import NumConv
+ from treebeard.models import Node
+diff --git a/treebeard/ns_tree.py b/treebeard/ns_tree.py
+index 9cdc4b3..a7909a0 100644
+--- a/treebeard/ns_tree.py
++++ b/treebeard/ns_tree.py
+@@ -1,15 +1,12 @@
+ """Nested Sets"""
+
+-import sys
+ import operator
+-
+-if sys.version_info >= (3, 0):
+- from functools import reduce
++from functools import reduce
+
+ from django.core import serializers
+ from django.db import connection, models, transaction
+ from django.db.models import Q
+-from django.utils.translation import ugettext_noop as _
++from django.utils.translation import gettext_noop as _
+
+ from treebeard.exceptions import InvalidMoveToDescendant, NodeAlreadySaved
+ from treebeard.models import Node
+diff --git a/treebeard/templatetags/admin_tree.py b/treebeard/templatetags/admin_tree.py
+index 89c0754..e446cf9 100644
+--- a/treebeard/templatetags/admin_tree.py
++++ b/treebeard/templatetags/admin_tree.py
+@@ -6,75 +6,42 @@ nodes change list - @jjdelc
+ """
+
+ import datetime
+-import sys
++from urllib.parse import urljoin
+
+-import django
+ from django.db import models
+ from django.conf import settings
+ from django.contrib.admin.templatetags.admin_list import (
+ result_headers, result_hidden_fields)
+-try:
+- from django.contrib.admin.utils import (
+- lookup_field, display_for_field, display_for_value)
+-except ImportError: # < Django 1.8
+- from django.contrib.admin.util import (
+- lookup_field, display_for_field, display_for_value)
++from django.contrib.admin.utils import (
++ lookup_field, display_for_field, display_for_value)
+ from django.core.exceptions import ObjectDoesNotExist
+ from django.template import Library
+-from django.utils.html import conditional_escape
++from django.utils.encoding import force_str
++from django.utils.html import conditional_escape, format_html
+ from django.utils.safestring import mark_safe
+-from django.utils.translation import ugettext_lazy as _
++from django.utils.translation import gettext_lazy as _
+
++from treebeard.templatetags import needs_checkboxes
+
+-if sys.version < '3':
+- import codecs
+-
+- def u(x):
+- return codecs.unicode_escape_decode(x)[0]
+-else:
+- def u(x):
+- return x
+
+ register = Library()
+
+-if sys.version_info >= (3, 0):
+- from django.utils.encoding import force_str
+- from urllib.parse import urljoin
+-else:
+- from django.utils.encoding import force_unicode as force_str
+- from urlparse import urljoin
+-
+-
+-from django.utils.html import format_html
+-
+-from treebeard.templatetags import needs_checkboxes
+-
+
+ def get_result_and_row_class(cl, field_name, result):
+- if django.VERSION >= (1, 9):
+- empty_value_display = cl.model_admin.get_empty_value_display()
+- else:
+- from django.contrib.admin.views.main import EMPTY_CHANGELIST_VALUE
+- empty_value_display = EMPTY_CHANGELIST_VALUE
++ empty_value_display = cl.model_admin.get_empty_value_display()
+ row_classes = ['field-%s' % field_name]
+ try:
+ f, attr, value = lookup_field(field_name, result, cl.model_admin)
+ except ObjectDoesNotExist:
+ result_repr = empty_value_display
+ else:
+- if django.VERSION >= (1, 9):
+- empty_value_display = getattr(
+- attr, 'empty_value_display', empty_value_display)
++ empty_value_display = getattr(attr, 'empty_value_display', empty_value_display)
+ if f is None:
+ if field_name == 'action_checkbox':
+ row_classes = ['action-checkbox']
+ allow_tags = getattr(attr, 'allow_tags', False)
+ boolean = getattr(attr, 'boolean', False)
+- if django.VERSION >= (1, 9):
+- result_repr = display_for_value(
+- value, empty_value_display, boolean)
+- else:
+- result_repr = display_for_value(value, boolean)
++ result_repr = display_for_value(value, empty_value_display, boolean)
+ # Strip HTML tags in the resulting text, except if the
+ # function has an "allow_tags" attribute set to True.
+ # WARNING: this will be deprecated in Django 2.0
+@@ -83,19 +50,14 @@ def get_result_and_row_class(cl, field_name, result):
+ if isinstance(value, (datetime.date, datetime.time)):
+ row_classes.append('nowrap')
+ else:
+- related_field_name = 'rel' if django.VERSION <= (2, 0) else 'remote_field'
+- if isinstance(getattr(f, related_field_name), models.ManyToOneRel):
++ if isinstance(getattr(f, 'remote_field'), models.ManyToOneRel):
+ field_val = getattr(result, f.name)
+ if field_val is None:
+ result_repr = empty_value_display
+ else:
+ result_repr = field_val
+ else:
+- if django.VERSION >= (1, 9):
+- result_repr = display_for_field(
+- value, f, empty_value_display)
+- else:
+- result_repr = display_for_field(value, f)
++ result_repr = display_for_field(value, f, empty_value_display)
+ if isinstance(f, (models.DateField, models.TimeField,
+ models.ForeignKey)):
+ row_classes.append('nowrap')
+@@ -172,7 +134,7 @@ def items_for_result(cl, result, form):
+ ' onclick="opener.dismissRelatedLookupPopup(window, %s);'
+ ' return false;"')
+ yield mark_safe(
+- u('%s<%s%s>%s %s <a href="%s"%s>%s</a></%s>') % (
++ '%s<%s%s>%s %s <a href="%s"%s>%s</a></%s>' % (
+ drag_handler, table_tag, row_class, spacer, collapse, url,
+ (cl.is_popup and onclickstr % result_id or ''),
+ conditional_escape(result_repr), table_tag))
+@@ -190,10 +152,9 @@ def items_for_result(cl, result, form):
+ ):
+ bf = form[field_name]
+ result_repr = mark_safe(force_str(bf.errors) + force_str(bf))
+- yield format_html(u('<td{0}>{1}</td>'), row_class, result_repr)
++ yield format_html('<td{0}>{1}</td>', row_class, result_repr)
+ if form and not form[cl.model._meta.pk.name].is_hidden:
+- yield format_html(u('<td>{0}</td>'),
+- force_str(form[cl.model._meta.pk.name]))
++ yield format_html('<td>{0}</td>', force_str(form[cl.model._meta.pk.name]))
+
+
+ def get_parent_id(node):
+diff --git a/treebeard/tests/settings.py b/treebeard/tests/settings.py
+index 39c9d43..47cc1c8 100644
+--- a/treebeard/tests/settings.py
++++ b/treebeard/tests/settings.py
+@@ -3,7 +3,6 @@ Django settings for testing treebeard
+ """
+
+ import os
+-import django
+
+
+ def get_db_conf():
+@@ -43,7 +42,7 @@ def get_db_conf():
+ 'NAME': 'master',
+ 'USER': 'sa',
+ 'PASSWORD': 'Password12!',
+- 'HOST': '(local)\SQL2016',
++ 'HOST': '(local)\\SQL2016',
+ 'PORT': '',
+ 'OPTIONS': {
+ 'driver': 'SQL Server Native Client 11.0',
+@@ -67,21 +66,9 @@ INSTALLED_APPS = [
+ # This little hacks forces Django into the old syncdb behaviour,
+ # creating models without migrations.
+
+-if django.VERSION >= (1, 9):
+- MIGRATION_MODULES = {app.split('.')[-1]: None for app in INSTALLED_APPS}
+-else:
+- class DisableMigrations(object):
++MIGRATION_MODULES = {app.split('.')[-1]: None for app in INSTALLED_APPS}
+
+- def __contains__(self, item):
+- return True
+-
+- def __getitem__(self, item):
+- return "notmigrations"
+-
+-
+- MIGRATION_MODULES = DisableMigrations()
+-
+-MIDDLEWARE_CLASSES = [
++MIDDLEWARE = [
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.contrib.messages.middleware.MessageMiddleware'
+diff --git a/treebeard/tests/test_treebeard.py b/treebeard/tests/test_treebeard.py
+index fbf86f3..b8049f0 100644
+--- a/treebeard/tests/test_treebeard.py
++++ b/treebeard/tests/test_treebeard.py
+@@ -1,11 +1,9 @@
+ # -*- coding: utf-8 -*-
+ """Unit/Functional tests"""
+
+-from __future__ import unicode_literals
+ import datetime
+ import os
+
+-from django import VERSION as DJANGO_VERSION
+ from django.contrib.admin.sites import AdminSite
+ from django.contrib.admin.views.main import ChangeList
+ from django.contrib.auth.models import User, AnonymousUser
+@@ -2374,16 +2372,10 @@ class TestAdminTree(TestNonEmptyTree):
+ m = admin_class(model, site)
+ list_display = m.get_list_display(request)
+ list_display_links = m.get_list_display_links(request, list_display)
+- if DJANGO_VERSION < (2, 1):
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m)
+- else:
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m, None)
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m, None)
+ cl.formset = None
+ context = Context({'cl': cl,
+ 'request': request})
+@@ -2420,16 +2412,10 @@ class TestAdminTree(TestNonEmptyTree):
+ m = UnicodeModelAdmin(model, site)
+ list_display = m.get_list_display(request)
+ list_display_links = m.get_list_display_links(request, list_display)
+- if DJANGO_VERSION < (2, 1):
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m)
+- else:
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m, None)
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m, None)
+ cl.formset = None
+ context = Context({'cl': cl,
+ 'request': request})
+@@ -2459,16 +2445,10 @@ class TestAdminTree(TestNonEmptyTree):
+ m = admin_class(model, site)
+ list_display = m.get_list_display(request)
+ list_display_links = m.get_list_display_links(request, list_display)
+- if DJANGO_VERSION < (2, 1):
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m)
+- else:
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m, None)
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m, None)
+ cl.formset = None
+ context = Context({'cl': cl,
+ 'request': request})
+@@ -2482,16 +2462,10 @@ class TestAdminTree(TestNonEmptyTree):
+ request.user = AnonymousUser()
+ list_display = m.get_list_display(request)
+ list_display_links = m.get_list_display_links(request, list_display)
+- if DJANGO_VERSION < (2, 1):
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m)
+- else:
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m, None)
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m, None)
+ cl.formset = None
+ context = Context({'cl': cl,
+ 'request': request})
+@@ -2505,16 +2479,10 @@ class TestAdminTree(TestNonEmptyTree):
+ request.user = AnonymousUser()
+ list_display = m.get_list_display(request)
+ list_display_links = m.get_list_display_links(request, list_display)
+- if DJANGO_VERSION < (2, 1):
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m)
+- else:
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m, None)
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m, None)
+ cl.formset = None
+ context = Context({'cl': cl,
+ 'request': request})
+@@ -2542,16 +2510,10 @@ class TestAdminTreeList(TestNonEmptyTree):
+ m = admin_class(model, site)
+ list_display = m.get_list_display(request)
+ list_display_links = m.get_list_display_links(request, list_display)
+- if DJANGO_VERSION < (2, 1):
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m)
+- else:
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m, None)
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m, None)
+ cl.formset = None
+ context = Context({'cl': cl,
+ 'request': request})
+@@ -2572,16 +2534,10 @@ class TestAdminTreeList(TestNonEmptyTree):
+ m = admin_class(model, site)
+ list_display = m.get_list_display(request)
+ list_display_links = m.get_list_display_links(request, list_display)
+- if DJANGO_VERSION < (2, 1):
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m)
+- else:
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m, None)
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m, None)
+ cl.formset = None
+ context = Context({'cl': cl,
+ 'request': request,
+@@ -2609,16 +2565,10 @@ class TestAdminTreeList(TestNonEmptyTree):
+ m = admin_class(model, site)
+ list_display = m.get_list_display(request)
+ list_display_links = m.get_list_display_links(request, list_display)
+- if DJANGO_VERSION < (2, 1):
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m)
+- else:
+- cl = ChangeList(request, model, list_display, list_display_links,
+- m.list_filter, m.date_hierarchy, m.search_fields,
+- m.list_select_related, m.list_per_page,
+- m.list_max_show_all, m.list_editable, m, None)
++ cl = ChangeList(request, model, list_display, list_display_links,
++ m.list_filter, m.date_hierarchy, m.search_fields,
++ m.list_select_related, m.list_per_page,
++ m.list_max_show_all, m.list_editable, m, None)
+ cl.formset = None
+ context = Context({'cl': cl,
+ 'request': request})
+--
+2.25.4
+
diff --git a/community/py3-django-treebeard/APKBUILD b/community/py3-django-treebeard/APKBUILD
index 244d8ff1a25..dacdd3a5675 100644
--- a/community/py3-django-treebeard/APKBUILD
+++ b/community/py3-django-treebeard/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
pkgname=py3-django-treebeard
pkgver=4.3.1
-pkgrel=0
+pkgrel=1
pkgdesc="Efficient tree implementations for Django"
url="https://github.com/django-treebeard/django-treebeard"
arch="noarch"
@@ -10,7 +10,19 @@ license="Apache-2.0"
depends="py3-django"
makedepends="py3-setuptools"
checkdepends="py3-pytest"
-source="$pkgname-$pkgver.tar.gz::https://github.com/django-treebeard/django-treebeard/archive/$pkgver.tar.gz"
+source="$pkgname-$pkgver.tar.gz::https://github.com/django-treebeard/django-treebeard/archive/$pkgver.tar.gz
+ 0001-Signature-of-ChangeList-changed-in-Django-2.1.patch
+ 0002-add-user-to-rrequest-object.patch
+ 0003-refactor-all-occurences-of-ChangeList.patch
+ 0004-Update-README.rst.patch
+ 0005-Update-README.rst.patch
+ 0006-docs-Fix-simple-typo-proprt-property.patch
+ 0007-Fix-pytest-installation-instructions.patch
+ 0008-Travis-CI-Get-PostgreSQL-server-back-on-default-port.patch
+ 0009-AppVeyor-Get-list-of-tox-environments-back-in-sync-w.patch
+ 0010-tox.ini-Document-state-of-environment-dj22-mssql.patch
+ 0011-Declare-support-for-Django-3-and-drop-support-for-EO.patch
+ "
builddir="$srcdir/django-treebeard-$pkgver"
@@ -29,4 +41,15 @@ package() {
python3 setup.py install --root "$pkgdir"
}
-sha512sums="0028bec918e3a269eade270842dac29bdbff4c87ad2606b240fc6796b04c2ff723b0fafae9c7c110aee3ef72e11f3a1a5877e6f21e29ea70c3e059f4cf32435a py3-django-treebeard-4.3.1.tar.gz"
+sha512sums="0028bec918e3a269eade270842dac29bdbff4c87ad2606b240fc6796b04c2ff723b0fafae9c7c110aee3ef72e11f3a1a5877e6f21e29ea70c3e059f4cf32435a py3-django-treebeard-4.3.1.tar.gz
+250cecccc6c4b87790034961c5ff61d85bfa4b6a6ecc6edce7a887fd91333e1c4a88391ca4d6989786e014f9c4d98d164fb129bf22fa6e72fbe0d363e13a9c85 0001-Signature-of-ChangeList-changed-in-Django-2.1.patch
+44f8f760b81c2a25c7da1e8f1b6546446a94b605c9404d58acba204ad53e8f247f012ee19962772437f98b1f74c3ede60f8d0cb602eed9bd03c7f04ed2958bea 0002-add-user-to-rrequest-object.patch
+7ad29c9ab6f5e8089b1ce9ab73057fbb2ce1471b657a8d1c13c2a9c3d22b3337542111cd323c26e9ecd634ac9d46981284c9e3c87fd7bb2838e2406b897a222a 0003-refactor-all-occurences-of-ChangeList.patch
+c8c046eaa6aa45a5a611ca3fe3c0274f29ea19dfe682f4c5bf6ed49668e293a95034bee4d5ea321b403cdc3b2ba4a6208869964772d1bb6e37935ced512b1a42 0004-Update-README.rst.patch
+bce3c8d0019be35d7a15d035146e1bfecec191fa238733eed2be35bdef3f9635209c0e9b25ba034c857fcb0785d2331fba807853cec9cfcf49427acb4d1f7463 0005-Update-README.rst.patch
+0185d08ddc876ee97e59a7c3c46b8e86c1f4d129ef1be66b15a97fd54795899aed5e4d21b2487d6566a994f639a29f9dac30b839c71077aefd939bc19716e70f 0006-docs-Fix-simple-typo-proprt-property.patch
+7fbea231931d61493df4b6c8e1ca8f3f5b0fba754c5a459b15de64ee750bd2b3ca391885b1866ff721ddc0a42dd10691701803c5616ec97aaa98776a6d72a6dd 0007-Fix-pytest-installation-instructions.patch
+a8bd7453a90b17414fae00ee59908944c1b98aed77c8b16223831bec40f08ded12c240d35ca389eba250dd61cd7645777ce0b306fbdd608994c841275021e286 0008-Travis-CI-Get-PostgreSQL-server-back-on-default-port.patch
+77a3ebd590403c7c6a5da94e7e3e4d12da4d5de47bd82db9a90105e0997858dc95d603fb40fe830fd806ecedd7c7c2b032a705b9129b870cd00afbb9ab84afe1 0009-AppVeyor-Get-list-of-tox-environments-back-in-sync-w.patch
+8de20781c33ef6ae290502870f12e11f0e6c9efe3187a1f62ee034997974ad3b83cf07409755c5c4b2cd7b674d4a75120ff52cce1e1c7167bd2769981b64aeba 0010-tox.ini-Document-state-of-environment-dj22-mssql.patch
+19e2d212b47bae8b9a7f0271464b01b5d3ef83285b54259620120ceeb7b6fbbceddf4bb33735eb37059edc7e23690d4553772d936af26af843366db2d3c01cad 0011-Declare-support-for-Django-3-and-drop-support-for-EO.patch"