Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-django-tables2 for openSUSE:Factory checked in at 2021-12-26 13:30:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-django-tables2 (Old) and /work/SRC/openSUSE:Factory/.python-django-tables2.new.2520 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-django-tables2" Sun Dec 26 13:30:30 2021 rev:3 rq:942563 version:2.4.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-django-tables2/python-django-tables2.changes 2021-05-20 19:25:46.369767164 +0200 +++ /work/SRC/openSUSE:Factory/.python-django-tables2.new.2520/python-django-tables2.changes 2021-12-26 13:30:49.234972516 +0100 @@ -1,0 +2,16 @@ +Fri Dec 24 04:34:19 UTC 2021 - John Vandenberg <jay...@gmail.com> + +- Prevent building on Leap Python 3.6 +- Update to v2.4.1 + * Add Persian (Farsi) locale + * Improved error message if openpyxl is not installed + * Use correct mime type for xlsx + * Add support for django 4.0, drop support for python 3.5 +- from v2.4.0 + * Add support for django 3.2 and python 3.9, drop support for django 3.0 + * Add Django 3.0 and 3.1 trove classifiers + * Strip leading and trailing whitespace from TemplateColumn.value() + * Providing link for django-bootstrap3 + * Fix for crash on windows while deleting temp file + +------------------------------------------------------------------- Old: ---- django-tables2-2.3.4.tar.gz New: ---- django-tables2-2.4.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-django-tables2.spec ++++++ --- /var/tmp/diff_new_pack.i8npl9/_old 2021-12-26 13:30:49.770972890 +0100 +++ /var/tmp/diff_new_pack.i8npl9/_new 2021-12-26 13:30:49.774972892 +0100 @@ -20,7 +20,7 @@ %define skip_python2 1 %define skip_python36 1 Name: python-django-tables2 -Version: 2.3.4 +Version: 2.4.1 Release: 0 Summary: Table/data-grid framework for Django License: BSD-2-Clause @@ -29,11 +29,12 @@ BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-Django >= 1.11 +Requires: python-Django >= 2.2 Suggests: python-tablib BuildArch: noarch # SECTION test requirements -BuildRequires: %{python_module Django >= 1.11} +BuildRequires: %{python_module base >= 3.7} +BuildRequires: %{python_module Django >= 2.2} BuildRequires: %{python_module django-filter >= 2.3.0} BuildRequires: %{python_module fudge} BuildRequires: %{python_module mock} @@ -58,11 +59,12 @@ %python_expand %fdupes %{buildroot}%{$python_sitelib} %check +# fudge causes two test failures on Python 3.6 from Leap %python_exec ./manage.py test %files %{python_files} %doc README.md CHANGELOG.md %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/django[-_]tables2*/ %changelog ++++++ django-tables2-2.3.4.tar.gz -> django-tables2-2.4.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/.github/workflows/ci.yml new/django-tables2-2.4.1/.github/workflows/ci.yml --- old/django-tables2-2.3.4/.github/workflows/ci.yml 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/.github/workflows/ci.yml 2021-10-05 21:27:23.000000000 +0200 @@ -31,15 +31,20 @@ runs-on: ubuntu-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8] - django-version: [2.2, 3.0, 3.1] + python-version: [3.6, 3.7, 3.8, 3.9] + django-version: [2.2, 3.1, 3.2, 4.0a1] exclude: - - python-version: 3.5 - django-version: 3.0 - - python-version: 3.5 - django-version: 3.1 + - python-version: 3.6 + django-version: 4.0a1 + - python-version: 3.7 + django-version: 4.0a1 - python-version: 3.8 django-version: 2.2 + - python-version: 3.9 + django-version: 2.2 + - python-version: "3.10" + django-version: 2.2 + steps: - name: Set up Python ${{ matrix.python-version }} @@ -47,7 +52,7 @@ with: python-version: ${{ matrix.python-version }} - uses: actions/checkout@v2 - - uses: actions/cache@v2.1.3 + - uses: actions/cache@v2.1.6 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/.pre-commit-config.yaml new/django-tables2-2.4.1/.pre-commit-config.yaml --- old/django-tables2-2.3.4/.pre-commit-config.yaml 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/.pre-commit-config.yaml 2021-10-05 21:27:23.000000000 +0200 @@ -1,6 +1,6 @@ repos: - repo: https://github.com/ambv/black - rev: stable + rev: 21.9b0 hooks: - id: black language_version: python3.7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/CHANGELOG.md new/django-tables2-2.4.1/CHANGELOG.md --- old/django-tables2-2.3.4/CHANGELOG.md 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/CHANGELOG.md 2021-10-05 21:27:23.000000000 +0200 @@ -1,5 +1,18 @@ # Change log +# 2.4.1 (2021-10-04) +- Add Persian (Farsi) locale ([#806](https://github.com/jieter/django-tables2/pull/806)) by [@Alirezaja1384](https://github.com/jieter/django-tables2/commits?author=Alirezaja1384) +- Improved error message if openpyxl is not installed ([#816](https://github.com/jieter/django-tables2/pull/816)) +- Use correct mime type for xlsx (fixes: [#810](https://github.com/jieter/django-tables2/issues/810)) +- Add support for django 4.0, drop support for python 3.5 ([#822](https://github.com/jieter/django-tables2/issues/822)) + +# 2.4.0 (2021-05-15) +- Add support for django 3.2 and python 3.9, drop support for django 3.0 +- Add Django 3.0 and 3.1 trove classifiers [#803](https://github.com/jieter/django-tables2/pull/803) by [@Asday](https://github.com/Asday) +- Strip leading and trailing whitespace from TemplateColumn.value() [#794](https://github.com/jieter/django-tables2/pull/794) by [@jeremystretch](https://github.com/jeremystretch) +- Providing link for django-bootstrap3 [#793](https://github.com/jieter/django-tables2/pull/793) by [@TareqMonwer](https://github.com/TareqMonwer) +- Fix for crash on windows while deleting temp file [#788](https://github.com/jieter/django-tables2/pull/788) + # 2.3.4 (2021-01-10) - Removed deprecation warnings with django==3.1 regarding `JSONField` [#785](https://github.com/jieter/django-tables2/pull/785) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/django_tables2/__init__.py new/django-tables2-2.4.1/django_tables2/__init__.py --- old/django-tables2-2.3.4/django_tables2/__init__.py 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/django_tables2/__init__.py 2021-10-05 21:27:23.000000000 +0200 @@ -20,7 +20,7 @@ from .utils import A from .views import MultiTableMixin, SingleTableMixin, SingleTableView -__version__ = "2.3.4" +__version__ = "2.4.1" __all__ = ( "Table", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/django_tables2/columns/templatecolumn.py new/django-tables2-2.4.1/django_tables2/columns/templatecolumn.py --- old/django-tables2-2.3.4/django_tables2/columns/templatecolumn.py 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/django_tables2/columns/templatecolumn.py 2021-10-05 21:27:23.000000000 +0200 @@ -71,6 +71,7 @@ """ The value returned from a call to `value()` on a `TemplateColumn` is the rendered template with `django.utils.html.strip_tags` applied. + Leading and trailing whitespace is stripped. """ html = super().value(**kwargs) - return strip_tags(html) if isinstance(html, str) else html + return strip_tags(html).strip() if isinstance(html, str) else html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/django_tables2/export/export.py new/django-tables2-2.4.1/django_tables2/export/export.py --- old/django-tables2-2.3.4/django_tables2/export/export.py 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/django_tables2/export/export.py 2021-10-05 21:27:23.000000000 +0200 @@ -40,7 +40,7 @@ ODS: "application/vnd.oasis.opendocument.spreadsheet", TSV: "text/tsv; charset=utf-8", XLS: "application/vnd.ms-excel", - XLSX: "application/vnd.ms-excel", + XLSX: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", YAML: "text/yaml; charset=utf-8", } @@ -87,7 +87,7 @@ """ Returns the string/bytes for the current export format """ - return getattr(self.dataset, self.format) + return self.dataset.export(self.format) def response(self, filename=None): """ Binary files old/django-tables2-2.3.4/django_tables2/locale/fa/LC_MESSAGES/django.mo and new/django-tables2-2.4.1/django_tables2/locale/fa/LC_MESSAGES/django.mo differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/django_tables2/locale/fa/LC_MESSAGES/django.po new/django-tables2-2.4.1/django_tables2/locale/fa/LC_MESSAGES/django.po --- old/django-tables2-2.3.4/django_tables2/locale/fa/LC_MESSAGES/django.po 1970-01-01 01:00:00.000000000 +0100 +++ new/django-tables2-2.4.1/django_tables2/locale/fa/LC_MESSAGES/django.po 2021-10-05 21:27:23.000000000 +0200 @@ -0,0 +1,38 @@ +# This file is distributed under the same license as the django-tables2 package +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: 2021-05-24 14:23+0430\n" +"PO-Revision-Date: 2021-05-24 14:31+0430\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: fa\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.4.1\n" + +#: paginators.py:72 +msgid "That page number is not an integer" +msgstr "?????????? ???????? ???????? ???????? ????????" + +#: paginators.py:74 +msgid "That page number is less than 1" +msgstr "?????????? ???????? ???????? ???????? ???? 1 ??????" + +#: paginators.py:93 +msgid "That page contains no results" +msgstr "???????? ???????? ?????? ?????????? ???? ????????" + +#: templates/django_tables2/bootstrap.html:66 +#: templates/django_tables2/bootstrap4.html:66 +#: templates/django_tables2/table.html:64 +msgid "previous" +msgstr "????????" + +#: templates/django_tables2/bootstrap.html:91 +#: templates/django_tables2/bootstrap4.html:86 +#: templates/django_tables2/table.html:88 +msgid "next" +msgstr "????????" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/docs/pages/api-reference.rst new/django-tables2-2.4.1/docs/pages/api-reference.rst --- old/django-tables2-2.3.4/docs/pages/api-reference.rst 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/docs/pages/api-reference.rst 2021-10-05 21:27:23.000000000 +0200 @@ -83,7 +83,7 @@ attrs = {"class": "paleblue"} If you supply a a callable as a value in the dict, it will be called - at table instantiation an the returned value will be used: + at table instantiation and the returned value will be used: Consider this example where each table gets an unique ``"id"`` attribute:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/docs/pages/export.rst new/django-tables2-2.4.1/docs/pages/export.rst --- old/django-tables2-2.3.4/docs/pages/export.rst 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/docs/pages/export.rst 2021-10-05 21:27:23.000000000 +0200 @@ -10,6 +10,10 @@ pip install tablib +.. note:: + For all supported formats (xls, xlsx, etc.), you must install additional dependencies: + `Installing tablib: <https://tablib.readthedocs.io/en/stable/install/#installing-tablib`_ + Adding ability to export the table data to a class based views looks like this:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/docs/pages/filtering.rst new/django-tables2-2.4.1/docs/pages/filtering.rst --- old/django-tables2-2.3.4/docs/pages/filtering.rst 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/docs/pages/filtering.rst 2021-10-05 21:27:23.000000000 +0200 @@ -23,7 +23,7 @@ The ``FilterSet`` is added to the template context in a ``filter`` variable by -default. A basic template rendering the filter (using django-bootstrap3) and +default. A basic template rendering the filter (using django-bootstrap3)[https://pypi.org/project/django-bootstrap3/] and table looks like this:: {% load render_table from django_tables2 %} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/example/app/migrations/0004_auto_fix_deprecation_warnings.py new/django-tables2-2.4.1/example/app/migrations/0004_auto_fix_deprecation_warnings.py --- old/django-tables2-2.3.4/example/app/migrations/0004_auto_fix_deprecation_warnings.py 1970-01-01 01:00:00.000000000 +0100 +++ new/django-tables2-2.4.1/example/app/migrations/0004_auto_fix_deprecation_warnings.py 2021-10-05 21:27:23.000000000 +0200 @@ -0,0 +1,39 @@ +# Generated by Django 3.2.6 on 2021-08-09 08:50 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("app", "0003_auto_20180416_1020"), + ] + + operations = [ + migrations.AlterField( + model_name="continent", + name="id", + field=models.BigAutoField( + auto_created=True, primary_key=True, serialize=False, verbose_name="ID" + ), + ), + migrations.AlterField( + model_name="country", + name="commonwealth", + field=models.BooleanField(null=True), + ), + migrations.AlterField( + model_name="country", + name="id", + field=models.BigAutoField( + auto_created=True, primary_key=True, serialize=False, verbose_name="ID" + ), + ), + migrations.AlterField( + model_name="person", + name="id", + field=models.BigAutoField( + auto_created=True, primary_key=True, serialize=False, verbose_name="ID" + ), + ), + ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/example/app/models.py new/django-tables2-2.4.1/example/app/models.py --- old/django-tables2-2.3.4/example/app/models.py 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/example/app/models.py 2021-10-05 21:27:23.000000000 +0200 @@ -19,7 +19,7 @@ population = models.PositiveIntegerField(verbose_name=_("population")) tz = models.CharField(max_length=50, blank=True) visits = models.PositiveIntegerField() - commonwealth = models.NullBooleanField() + commonwealth = models.BooleanField(null=True) flag = models.FileField(upload_to="country/flags/", blank=True) continent = models.ForeignKey(Continent, null=True, on_delete=models.CASCADE) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/example/requirements.txt new/django-tables2-2.4.1/example/requirements.txt --- old/django-tables2-2.3.4/example/requirements.txt 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/example/requirements.txt 2021-10-05 21:27:23.000000000 +0200 @@ -1,6 +1,6 @@ -e .. -django-bootstrap3==11.0.0 -django-bootstrap4==0.0.8 -django-debug-toolbar==1.11 -django-filter==2.2 -tablib==0.13.0 +django-bootstrap3==15.0.0 +django-bootstrap4==3.0.1 +django-debug-toolbar==3.2.1 +django-filter==2.4.0 +tablib==3.0.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/example/settings.py new/django-tables2-2.4.1/example/settings.py --- old/django-tables2-2.3.4/example/settings.py 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/example/settings.py 2021-10-05 21:27:23.000000000 +0200 @@ -17,7 +17,7 @@ DATABASES = { "default": {"ENGINE": "django.db.backends.sqlite3", "NAME": join(ROOT, "database.sqlite")} } - +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # although not all choices may be available on all operating systems. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/requirements/common.pip new/django-tables2-2.4.1/requirements/common.pip --- old/django-tables2-2.3.4/requirements/common.pip 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/requirements/common.pip 2021-10-05 21:27:23.000000000 +0200 @@ -8,5 +8,5 @@ # https://bitbucket.org/openpyxl/openpyxl/issues/1373/broken-writer-with-lxml-defusedxml openpyxl==2.6.4 mock==3.0.5 -psycopg2-binary==2.8.5 +psycopg2-binary==2.9.1 django-filter==2.3.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/requirements/django-dev.pip new/django-tables2-2.4.1/requirements/django-dev.pip --- old/django-tables2-2.3.4/requirements/django-dev.pip 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/requirements/django-dev.pip 2021-10-05 21:27:23.000000000 +0200 @@ -1,2 +1,2 @@ -r common.pip -Django==3.0.9 +Django==3.2.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/setup.py new/django-tables2-2.4.1/setup.py --- old/django-tables2-2.3.4/setup.py 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/setup.py 2021-10-05 21:27:23.000000000 +0200 @@ -25,8 +25,10 @@ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", - "Framework :: Django :: 2.1", "Framework :: Django :: 2.2", + "Framework :: Django :: 3.1", + "Framework :: Django :: 3.2", + "Framework :: Django :: 4.0", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", @@ -37,6 +39,8 @@ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries", ], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/tests/app/migrations/0001_initial.py new/django-tables2-2.4.1/tests/app/migrations/0001_initial.py --- old/django-tables2-2.3.4/tests/app/migrations/0001_initial.py 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/tests/app/migrations/0001_initial.py 2021-10-05 21:27:23.000000000 +0200 @@ -1,4 +1,4 @@ -# Generated by Django 2.0 on 2019-09-23 17:47 +# Generated by Django 4.0a1 on 2021-09-22 18:51 from django.db import migrations, models import django.db.models.deletion @@ -8,35 +8,25 @@ initial = True - dependencies = [("contenttypes", "0002_remove_content_type_name")] + dependencies = [ + ("contenttypes", "0002_remove_content_type_name"), + ] operations = [ migrations.CreateModel( - name="Group", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, primary_key=True, serialize=False, verbose_name="ID" - ), - ), - ("name", models.CharField(max_length=200)), - ], - ), - migrations.CreateModel( name="Occupation", fields=[ ( "id", - models.AutoField( + models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID" ), ), ("name", models.CharField(max_length=200)), - ("boolean", models.NullBooleanField()), + ("boolean", models.BooleanField(null=True)), ( "boolean_with_choices", - models.NullBooleanField(choices=[(True, "Yes"), (False, "No")]), + models.BooleanField(choices=[(True, "Yes"), (False, "No")], null=True), ), ], ), @@ -45,7 +35,7 @@ fields=[ ( "id", - models.AutoField( + models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID" ), ), @@ -71,7 +61,7 @@ blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, - to="contenttypes.ContentType", + to="contenttypes.contenttype", ), ), ("friends", models.ManyToManyField(to="app.Person")), @@ -81,66 +71,86 @@ null=True, on_delete=django.db.models.deletion.CASCADE, related_name="people", - to="app.Occupation", + to="app.occupation", verbose_name="occupation of the person", ), ), ], - options={"verbose_name": "person", "verbose_name_plural": "people"}, + options={ + "verbose_name": "person", + "verbose_name_plural": "people", + }, ), migrations.CreateModel( - name="PersonInformation", + name="Region", fields=[ ( "id", - models.AutoField( + models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID" ), ), + ("name", models.CharField(max_length=200)), ( - "person", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="info_list", - to="app.Person", - verbose_name="Information", + "mayor", + models.OneToOneField( + null=True, on_delete=django.db.models.deletion.CASCADE, to="app.person" ), ), ], + options={ + "ordering": ["name"], + }, ), migrations.CreateModel( - name="Region", + name="PersonInformation", fields=[ ( "id", - models.AutoField( + models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID" ), ), - ("name", models.CharField(max_length=200)), ( - "mayor", - models.OneToOneField( - null=True, on_delete=django.db.models.deletion.CASCADE, to="app.Person" + "person", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="info_list", + to="app.person", + verbose_name="Information", ), ), ], - options={"ordering": ["name"]}, ), migrations.AddField( model_name="occupation", name="region", field=models.ForeignKey( - null=True, on_delete=django.db.models.deletion.CASCADE, to="app.Region" + null=True, on_delete=django.db.models.deletion.CASCADE, to="app.region" ), ), - migrations.AddField( - model_name="group", name="members", field=models.ManyToManyField(to="app.Person") + migrations.CreateModel( + name="Group", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, primary_key=True, serialize=False, verbose_name="ID" + ), + ), + ("name", models.CharField(max_length=200)), + ("members", models.ManyToManyField(to="app.Person")), + ], ), migrations.CreateModel( name="PersonProxy", fields=[], - options={"ordering": ("last_name",), "proxy": True, "indexes": []}, + options={ + "ordering": ("last_name",), + "proxy": True, + "indexes": [], + "constraints": [], + }, bases=("app.person",), ), ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/tests/app/migrations/0002_auto_20200812_0958.py new/django-tables2-2.4.1/tests/app/migrations/0002_auto_20200812_0958.py --- old/django-tables2-2.3.4/tests/app/migrations/0002_auto_20200812_0958.py 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/tests/app/migrations/0002_auto_20200812_0958.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,19 +0,0 @@ -# Generated by Django 3.0.8 on 2020-08-12 07:58 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [("app", "0001_initial")] - - operations = [ - migrations.AlterField( - model_name="occupation", name="boolean", field=models.BooleanField(null=True) - ), - migrations.AlterField( - model_name="occupation", - name="boolean_with_choices", - field=models.BooleanField(choices=[(True, "Yes"), (False, "No")], null=True), - ), - ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/tests/app/settings.py new/django-tables2-2.4.1/tests/app/settings.py --- old/django-tables2-2.3.4/tests/app/settings.py 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/tests/app/settings.py 2021-10-05 21:27:23.000000000 +0200 @@ -1,4 +1,5 @@ DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}} +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" INSTALLED_APPS = [ "django.contrib.auth", @@ -21,8 +22,4 @@ TIME_ZONE = "Europe/Amsterdam" -SHORT_DATE_FORMAT = "Y-m-d" -TIME_FORMAT = "H:i:s" -SHORT_DATETIME_FORMAT = "Y-m-d H:i:s" - USE_TZ = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/tests/columns/test_datecolumn.py new/django-tables2-2.4.1/tests/columns/test_datecolumn.py --- old/django-tables2-2.3.4/tests/columns/test_datecolumn.py 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/tests/columns/test_datecolumn.py 2021-10-05 21:27:23.000000000 +0200 @@ -1,7 +1,7 @@ from datetime import date from django.db import models -from django.test import SimpleTestCase, override_settings +from django.test import SimpleTestCase import django_tables2 as tables @@ -35,7 +35,6 @@ ) self.assertEqual(table.rows[1].get_cell("date"), "???") - @override_settings(DATE_FORMAT="D Y b") def test_should_handle_long_format(self): class TestTable(tables.Table): date = tables.DateColumn(short=False) @@ -44,10 +43,9 @@ default = "???" table = TestTable([{"date": date(2012, 9, 11)}, {"date": None}]) - assert table.rows[0].get_cell("date") == "Tue 2012 sep" - assert table.rows[1].get_cell("date") == "???" + self.assertEqual(table.rows[0].get_cell("date"), "Sept. 11, 2012") + self.assertEqual(table.rows[1].get_cell("date"), "???") - @override_settings(SHORT_DATE_FORMAT="b Y D") def test_should_handle_short_format(self): class TestTable(tables.Table): date = tables.DateColumn(short=True) @@ -56,8 +54,8 @@ default = "???" table = TestTable([{"date": date(2012, 9, 11)}, {"date": None}]) - assert table.rows[0].get_cell("date") == "sep 2012 Tue" - assert table.rows[1].get_cell("date") == "???" + self.assertEqual(table.rows[0].get_cell("date"), "09/11/2012") + self.assertEqual(table.rows[1].get_cell("date"), "???") def test_should_be_used_for_datefields(self): class DateModel(models.Model): @@ -72,14 +70,13 @@ self.assertEqual(type(Table.base_columns["field"]), tables.DateColumn) - @override_settings(SHORT_DATE_FORMAT="b Y D") def test_value_returns_a_raw_value_without_html(self): class Table(tables.Table): date = tables.DateColumn() date_linkify = tables.DateColumn(accessor="date", linkify=isoformat_link) table = Table([{"date": date(2012, 9, 12)}]) - self.assertEqual(table.rows[0].get_cell_value("date"), "sep 2012 Wed") + self.assertEqual(table.rows[0].get_cell_value("date"), "09/12/2012") self.assertEqual( - table.rows[0].get_cell("date_linkify"), '<a href="/test/2012-09-12/">sep 2012 Wed</a>' + table.rows[0].get_cell("date_linkify"), '<a href="/test/2012-09-12/">09/12/2012</a>' ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/tests/columns/test_datetimecolumn.py new/django-tables2-2.4.1/tests/columns/test_datetimecolumn.py --- old/django-tables2-2.3.4/tests/columns/test_datetimecolumn.py 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/tests/columns/test_datetimecolumn.py 2021-10-05 21:27:23.000000000 +0200 @@ -3,7 +3,7 @@ import pytz from django.conf import settings from django.db import models -from django.test import SimpleTestCase, override_settings +from django.test import SimpleTestCase import django_tables2 as tables @@ -44,7 +44,6 @@ ) self.assertEqual(table.rows[1].get_cell("date"), "???") - @override_settings(DATETIME_FORMAT="D Y b A f") def test_should_handle_long_format(self): class TestTable(tables.Table): date = tables.DateTimeColumn(short=False) @@ -53,10 +52,9 @@ default = "???" table = TestTable([{"date": self.dt()}, {"date": None}]) - self.assertEqual(table.rows[0].get_cell("date"), "Tue 2012 sep PM 12:30") + self.assertEqual(table.rows[0].get_cell("date"), "Sept. 11, 2012, 12:30 p.m.") self.assertEqual(table.rows[1].get_cell("date"), "???") - @override_settings(SHORT_DATETIME_FORMAT="b Y D A f") def test_should_handle_short_format(self): class TestTable(tables.Table): date = tables.DateTimeColumn(short=True) @@ -65,7 +63,7 @@ default = "???" table = TestTable([{"date": self.dt()}, {"date": None}]) - self.assertEqual(table.rows[0].get_cell("date"), "sep 2012 Tue PM 12:30") + self.assertEqual(table.rows[0].get_cell("date"), "09/11/2012 12:30 p.m.") self.assertEqual(table.rows[1].get_cell("date"), "???") def test_should_be_used_for_datetimefields(self): @@ -81,10 +79,9 @@ self.assertIsInstance(Table.base_columns["field"], tables.DateTimeColumn) - @override_settings(SHORT_DATETIME_FORMAT="b Y D A f") def test_value_returns_a_raw_value_without_html(self): class Table(tables.Table): col = tables.DateTimeColumn() table = Table([{"col": self.dt()}]) - self.assertEqual(table.rows[0].get_cell_value("col"), "sep 2012 Tue PM 12:30") + self.assertEqual(table.rows[0].get_cell_value("col"), "09/11/2012 12:30 p.m.") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/tests/columns/test_templatecolumn.py new/django-tables2-2.4.1/tests/columns/test_templatecolumn.py --- old/django-tables2-2.3.4/tests/columns/test_templatecolumn.py 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/tests/columns/test_templatecolumn.py 2021-10-05 21:27:23.000000000 +0200 @@ -107,3 +107,11 @@ table = Table([{"track": "Space Oddity"}]) self.assertEqual(list(table.as_values()), [["Track"], ["Space Oddity"]]) + + def test_should_strip_whitespace_for_value(self): + class Table(tables.Table): + track = tables.TemplateColumn(" {{ value }} ") + + table = Table([{"track": "Space Oddity"}]) + + self.assertEqual(list(table.as_values()), [["Track"], ["Space Oddity"]]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/tests/test_core.py new/django-tables2-2.4.1/tests/test_core.py --- old/django-tables2-2.3.4/tests/test_core.py 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/tests/test_core.py 2021-10-05 21:27:23.000000000 +0200 @@ -536,7 +536,7 @@ self.fail("__bool__ should not be evaluated!") def test_attrs_falsy_object(self): - """Computed attrs in BoundColumn should be passed the column value, even if its __bool__ returns False. """ + """Computed attrs in BoundColumn should be passed the column value, even if its __bool__ returns False.""" class Table(tables.Table): c_element = tables.Column() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/tests/test_export.py new/django-tables2-2.4.1/tests/test_export.py --- old/django-tables2-2.3.4/tests/test_export.py 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/tests/test_export.py 2021-10-05 21:27:23.000000000 +0200 @@ -1,4 +1,5 @@ import json +import os from datetime import date, datetime, time from tempfile import NamedTemporaryFile from unittest import skipIf @@ -218,11 +219,15 @@ response = View.as_view()(build_request("/?_export=xlsx")) self.assertEqual(response.status_code, 200) - with NamedTemporaryFile(suffix=".xlsx") as tmp: + tmp = NamedTemporaryFile(suffix=".xlsx", delete=False) + try: tmp.write(response.content) tmp.seek(0) wb = load_workbook(tmp.name) self.assertIn(title, wb.sheetnames) + finally: + tmp.close() + os.unlink(tmp.name) class OccupationTable(tables.Table): @@ -285,13 +290,11 @@ response = View.as_view()(build_request("/?_export=csv")) data = response.getvalue().decode("utf8") - expected_csv = "\r\n".join( - ("Date,Time,Datetime", "2019-07-22,11:11:11,2019-07-22 13:11:11", "") - ) + expected_csv = "Date,Time,Datetime\r\n07/22/2019,11:11 a.m.,07/22/2019 1:11 p.m.\r\n" self.assertEqual(data, expected_csv) response = View.as_view()(build_request("/?_export=xls")) - self.assertIn("2019-07-22 13:11:11".encode(), response.content) + self.assertIn("07/22/2019 1:11 p.m.".encode(), response.content) def test_export_invisible_columns(self): """Verify columns with visible=False *do* get exported.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-tables2-2.3.4/tox.ini new/django-tables2-2.4.1/tox.ini --- old/django-tables2-2.3.4/tox.ini 2021-01-10 13:04:00.000000000 +0100 +++ new/django-tables2-2.4.1/tox.ini 2021-10-05 21:27:23.000000000 +0200 @@ -2,13 +2,13 @@ args_are_paths = false envlist = py35-{2.2}, - py36-{2.2,3.0,3.1,master}, - py37-{2.2,3.0,3.1,master}, - py38-{3.0,3.1,master}, + py36-{2.2,3.1,3.2,master}, + py37-{2.2,3.1,3.2,master}, + py38-{3.1,3.2,4.0,master}, + py39-{3.2,4.0,master} docs, flake8, isort, - black [testenv] basepython = @@ -16,6 +16,8 @@ py36: python3.6 py37: python3.7 py38: python3.8 + py39: python3.9 + py310: python3.10 usedevelop = true pip_pre = true setenv = @@ -25,8 +27,9 @@ coverage run --source=django_tables2 manage.py test {posargs} deps = 2.2: Django==2.2.* - 3.0: Django==3.0.* 3.1: Django==3.1.* + 3.2: Django==3.2.* + 4.0: Django==4.0a1 master: https://github.com/django/django/archive/master.tar.gz coverage -r{toxinidir}/requirements/common.pip @@ -53,12 +56,6 @@ exclude = .git,__pycache__,.tox,example/app/migrations max-line-length = 120 -[testenv:black] -basepython = python3.8 -passenv = LC_CTYPE -deps = black==19.10b0 -commands = black --check . - [testenv:isort] basepython = python3.8 deps =