Addresses #6820. Treebeard 4.5 introduces a model change that will generate a phantom _auto migration the next time developers run makemigrations - this will cause migration dependency issues when it's absent on other environments, or on subsequent Wagtail upgrades. We need to coordinate the upgrade to Treebeard 4.5 with a corresponding migration shipped with Wagtail.
Ref #6463, #6428
* pin isort to 5.6.4
* update isort version mentioned in python_guidelines.rst
* make lint commands consistent between make lint and circleci
* fix isort errors on files outside of /wagtail
* speed up isort by ignoring additional directories and filetypes
* Use Django modelcluster's copy_all_child_relations method
* page.specific.__class__ => page.specific_class
* Use child_object_map as returned by modelcluster for revision rewriting
* Use modelcluster to commit child relations
* Use a callback instead of a method for _save_copy_instance
* Make CopyMixin work on non-MTI models
* Make gathering exclude_fields the job of the callee
._copy() no longer depends on any custom attributes in the base class!
* Converted CopyMixin into some utility methods (and renamed some stuff)
* Don't commit the new page in _copy
* Refactor _copy_m2m_relations to be more standalone
* Merge _make_copy into _copy
Not really useful outside _copy
* Give unused variable a name
* Version-bump django-modelcluster to 5.1
* Address review feedback
Co-authored-by: Matt Westcott <matt@west.co.tt>
- Add anyascii to replace unidecode
- Update wagtail.core.utils.string_to_ascii to use anyascii.
- Anyascii has a similar but not exactly the same encoding - see updates to tests.
Refs https://github.com/wagtail/wagtail/issues/3311
django-taggit 1.x drops Python 2.x support and thus the dependency on django.utils.six; this is a prerequisite for supporting Django 3.0.
The signature of TaggableManager.value_from_object has changed to return a list of Tags (previously it was a QuerySet of TaggedItems) and so search indexing and comparison need to be updated accordingly. There is a corresponding fix to ClusterTaggableManager in django-modelcluster 5.0.