From a7f53a0dca9304d8802e63807a972491b839fb47 Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Thu, 6 Jan 2022 15:22:15 +0000 Subject: [PATCH] Upgrade taggit to 2.x --- docs/releases/2.16.md | 5 ++++- setup.py | 6 +----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/releases/2.16.md b/docs/releases/2.16.md index cd61724ace..9a9d8dae18 100644 --- a/docs/releases/2.16.md +++ b/docs/releases/2.16.md @@ -47,7 +47,6 @@ Django 3.0 and 3.1 are no longer supported as of this release; please upgrade to Django 3.2 or above before upgrading Wagtail. - ### Removed support for Python 3.6 Python 3.6 is no longer supported as of this release; please upgrade to Python 3.7 or above before upgrading Wagtail. @@ -66,6 +65,10 @@ should be rewritten as: self.assertEqual(list(page.body[0].value), ['hello', 'goodbye']) ``` +### Change to `set` method on tag fields + +This release upgrades the [django-taggit](https://django-taggit.readthedocs.io/en/latest/) library to 2.x, which introduces one breaking change: the `TaggableManager.set` method now accepts a list of tags as a single argument, rather than a variable number of arguments. Code such as `page.tags.set('red', 'blue')` should be updated to `page.tags.set(['red', 'blue'])`. + ### `wagtail.admin.views.generic.DeleteView` follows Django 4.0 conventions The internal (undocumented) class-based view `wagtail.admin.views.generic.DeleteView` has been updated to align with [Django 4.0's `DeleteView` implementation](https://docs.djangoproject.com/en/4.0/releases/4.0/#deleteview-changes), which uses `FormMixin` to handle POST requests. Any custom deletion logic in `delete()` handlers should be moved to `form_valid()`. diff --git a/setup.py b/setup.py index 17ba719119..d5220b3d09 100755 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ except ImportError: install_requires = [ "Django>=3.2,<4.0", "django-modelcluster>=5.2,<6.0", - "django-taggit>=1.0,<2.0", + "django-taggit>=2.0,<3.0", "django-treebeard>=4.2.0,<5.0,!=4.5", "djangorestframework>=3.11.1,<4.0", "django-filter>=2.2,<22", @@ -67,10 +67,6 @@ testing_extras = [ # Pipenv hack to fix broken dependency causing CircleCI failures 'docutils==0.15', - # django-taggit 1.3.0 made changes to verbose_name which affect migrations; - # the test suite migrations correspond to >=1.3.0 - 'django-taggit>=1.3.0,<2.0', - # for validating string formats in .po translation files 'polib>=1.1,<2.0', ]