kopia lustrzana https://github.com/wagtail/wagtail
Upgrade django-taggit to 1.x
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.pull/5518/head
rodzic
525cf5922e
commit
34c1b4ccbe
|
@ -10,6 +10,7 @@ Changelog
|
||||||
* Move and refactor upgrade notification JS (Jonny Scholes)
|
* Move and refactor upgrade notification JS (Jonny Scholes)
|
||||||
* Add ability to insert internal anchor links/links with fragment identifiers in Draftail (rich text) fields (Iman Syed)
|
* Add ability to insert internal anchor links/links with fragment identifiers in Draftail (rich text) fields (Iman Syed)
|
||||||
* Remove need for Elasticsearch `update_all_types` workaround, upgrade minimum release to 6.4.0 or above (Jonathan Liuti)
|
* Remove need for Elasticsearch `update_all_types` workaround, upgrade minimum release to 6.4.0 or above (Jonathan Liuti)
|
||||||
|
* Upgrade django-modelcluster to>=5.0 and upgrade django-taggit to >=1.0 for Django 3.0 support (Matt Westcott)
|
||||||
* Fix: Added line breaks to long filenames on multiple image / document uploader (Kevin Howbrook)
|
* Fix: Added line breaks to long filenames on multiple image / document uploader (Kevin Howbrook)
|
||||||
* Fix: Added https support for Scribd oEmbed provider (Rodrigo)
|
* Fix: Added https support for Scribd oEmbed provider (Rodrigo)
|
||||||
* Fix: Changed StreamField group labels color so labels are visible (Catherine Farman)
|
* Fix: Changed StreamField group labels color so labels are visible (Catherine Farman)
|
||||||
|
|
|
@ -25,6 +25,8 @@ Other features
|
||||||
* Remove need for Elasticsearch ``update_all_types`` workaround, upgrade minimum release to 6.4.0 or above (Jonathan Liuti)
|
* Remove need for Elasticsearch ``update_all_types`` workaround, upgrade minimum release to 6.4.0 or above (Jonathan Liuti)
|
||||||
* Add ability to insert internal anchor links/links with fragment identifiers in Draftail (rich text) fields (Iman Syed)
|
* Add ability to insert internal anchor links/links with fragment identifiers in Draftail (rich text) fields (Iman Syed)
|
||||||
* Added Table Block caption for accessibility (Rahmi Pruitt)
|
* Added Table Block caption for accessibility (Rahmi Pruitt)
|
||||||
|
* Upgrade django-modelcluster to>=5.0 and upgrade django-taggit to >=1.0 for Django 3.0 support (Matt Westcott)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Bug fixes
|
Bug fixes
|
||||||
|
|
4
setup.py
4
setup.py
|
@ -22,8 +22,8 @@ except ImportError:
|
||||||
|
|
||||||
install_requires = [
|
install_requires = [
|
||||||
"Django>=2.0,<2.3",
|
"Django>=2.0,<2.3",
|
||||||
"django-modelcluster>=4.2,<5.0",
|
"django-modelcluster>=5.0,<6.0",
|
||||||
"django-taggit>=0.23,<1.0",
|
"django-taggit>=1.0,<2.0",
|
||||||
"django-treebeard>=4.2.0,<5.0",
|
"django-treebeard>=4.2.0,<5.0",
|
||||||
"djangorestframework>=3.7.4,<4.0",
|
"djangorestframework>=3.7.4,<4.0",
|
||||||
"draftjs_exporter>=2.1.5,<3.0",
|
"draftjs_exporter>=2.1.5,<3.0",
|
||||||
|
|
|
@ -274,19 +274,6 @@ class M2MFieldComparison(FieldComparison):
|
||||||
|
|
||||||
|
|
||||||
class TagsFieldComparison(M2MFieldComparison):
|
class TagsFieldComparison(M2MFieldComparison):
|
||||||
def get_items(self):
|
|
||||||
tags_a = [
|
|
||||||
tag.tag
|
|
||||||
for tag in self.val_a
|
|
||||||
]
|
|
||||||
|
|
||||||
tags_b = [
|
|
||||||
tag.tag
|
|
||||||
for tag in self.val_b
|
|
||||||
]
|
|
||||||
|
|
||||||
return tags_a, tags_b
|
|
||||||
|
|
||||||
def get_item_display(self, tag):
|
def get_item_display(self, tag):
|
||||||
return tag.slug
|
return tag.slug
|
||||||
|
|
||||||
|
|
|
@ -225,9 +225,9 @@ class BaseField:
|
||||||
if hasattr(field, 'get_searchable_content'):
|
if hasattr(field, 'get_searchable_content'):
|
||||||
value = field.get_searchable_content(value)
|
value = field.get_searchable_content(value)
|
||||||
elif isinstance(field, TaggableManager):
|
elif isinstance(field, TaggableManager):
|
||||||
# Special case for tags fields. Convert QuerySet of TaggedItems into QuerySet of Tags
|
# As of django-taggit 1.0, value_from_object returns a list of Tag objects,
|
||||||
Tag = field.remote_field.model
|
# which matches what we want
|
||||||
value = Tag.objects.filter(id__in=value.values_list('tag_id', flat=True))
|
pass
|
||||||
elif isinstance(field, RelatedField):
|
elif isinstance(field, RelatedField):
|
||||||
# The type of the ForeignKey may have a get_searchable_content method that we should
|
# The type of the ForeignKey may have a get_searchable_content method that we should
|
||||||
# call. Firstly we need to find the field its referencing but it may be referencing
|
# call. Firstly we need to find the field its referencing but it may be referencing
|
||||||
|
|
Ładowanie…
Reference in New Issue