wagtail 6.4__py3-none-any.whl → 6.4.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. wagtail/__init__.py +1 -1
  2. wagtail/admin/filters.py +9 -2
  3. wagtail/admin/locale/en_IN/LC_MESSAGES/djangojs.po +2 -2
  4. wagtail/admin/locale/es_VE/LC_MESSAGES/djangojs.po +2 -2
  5. wagtail/admin/locale/he_IL/LC_MESSAGES/djangojs.po +2 -2
  6. wagtail/admin/locale/hr_HR/LC_MESSAGES/djangojs.po +2 -2
  7. wagtail/admin/locale/is_IS/LC_MESSAGES/djangojs.po +2 -2
  8. wagtail/admin/locale/it/LC_MESSAGES/django.po +3 -3
  9. wagtail/admin/locale/nb/LC_MESSAGES/djangojs.po +2 -2
  10. wagtail/admin/locale/nl/LC_MESSAGES/django.mo +0 -0
  11. wagtail/admin/locale/nl/LC_MESSAGES/django.po +1 -1
  12. wagtail/admin/locale/pl/LC_MESSAGES/django.po +3 -2
  13. wagtail/admin/locale/pt_BR/LC_MESSAGES/djangojs.po +2 -2
  14. wagtail/admin/locale/sk_SK/LC_MESSAGES/djangojs.po +2 -2
  15. wagtail/admin/locale/tr_TR/LC_MESSAGES/djangojs.po +2 -2
  16. wagtail/admin/locale/zh_Hans/LC_MESSAGES/djangojs.po +2 -2
  17. wagtail/admin/locale/zh_Hant/LC_MESSAGES/djangojs.po +2 -2
  18. wagtail/admin/static/wagtailadmin/css/core.css +1 -1
  19. wagtail/admin/static/wagtailadmin/js/wagtailadmin.js +1 -1
  20. wagtail/admin/templates/wagtailadmin/home/upgrade_notification.html +1 -0
  21. wagtail/admin/tests/test_upgrade_notification.py +3 -0
  22. wagtail/contrib/search_promotions/locale/ca/LC_MESSAGES/django.po +3 -3
  23. wagtail/contrib/search_promotions/locale/cy/LC_MESSAGES/django.po +3 -3
  24. wagtail/contrib/search_promotions/locale/de/LC_MESSAGES/django.po +3 -3
  25. wagtail/contrib/search_promotions/locale/fr/LC_MESSAGES/django.po +3 -3
  26. wagtail/contrib/search_promotions/locale/gl/LC_MESSAGES/django.po +3 -3
  27. wagtail/contrib/search_promotions/locale/hr_HR/LC_MESSAGES/django.po +3 -3
  28. wagtail/contrib/search_promotions/locale/hu/LC_MESSAGES/django.po +3 -3
  29. wagtail/contrib/search_promotions/locale/is_IS/LC_MESSAGES/django.po +3 -3
  30. wagtail/contrib/search_promotions/locale/nl/LC_MESSAGES/django.po +3 -3
  31. wagtail/contrib/search_promotions/locale/ro/LC_MESSAGES/django.po +3 -3
  32. wagtail/contrib/search_promotions/locale/ru/LC_MESSAGES/django.po +3 -3
  33. wagtail/contrib/search_promotions/locale/sl/LC_MESSAGES/django.po +3 -3
  34. wagtail/contrib/search_promotions/locale/ug/LC_MESSAGES/django.po +3 -3
  35. wagtail/contrib/simple_translation/locale/hr_HR/LC_MESSAGES/django.po +2 -2
  36. wagtail/contrib/simple_translation/locale/is_IS/LC_MESSAGES/django.po +2 -2
  37. wagtail/contrib/simple_translation/locale/nb/LC_MESSAGES/django.po +2 -2
  38. wagtail/contrib/simple_translation/locale/pt_BR/LC_MESSAGES/django.po +2 -2
  39. wagtail/contrib/simple_translation/locale/zh_Hans/LC_MESSAGES/django.po +2 -2
  40. wagtail/contrib/simple_translation/locale/zh_Hant/LC_MESSAGES/django.po +2 -2
  41. wagtail/contrib/typed_table_block/locale/is_IS/LC_MESSAGES/django.po +2 -2
  42. wagtail/contrib/typed_table_block/locale/pt_BR/LC_MESSAGES/django.po +2 -2
  43. wagtail/contrib/typed_table_block/locale/zh_Hans/LC_MESSAGES/django.po +2 -2
  44. wagtail/contrib/typed_table_block/locale/zh_Hant/LC_MESSAGES/django.po +2 -2
  45. wagtail/images/signal_handlers.py +1 -1
  46. wagtail/locale/de/LC_MESSAGES/django.po +2 -2
  47. wagtail/locale/fi/LC_MESSAGES/django.po +2 -2
  48. wagtail/locale/pt_PT/LC_MESSAGES/django.po +2 -2
  49. wagtail/locales/locale/he_IL/LC_MESSAGES/django.po +2 -2
  50. wagtail/locales/locale/hr_HR/LC_MESSAGES/django.po +2 -2
  51. wagtail/locales/locale/is_IS/LC_MESSAGES/django.po +2 -2
  52. wagtail/locales/locale/nb/LC_MESSAGES/django.po +2 -2
  53. wagtail/locales/locale/pt_BR/LC_MESSAGES/django.po +2 -2
  54. wagtail/locales/locale/sk_SK/LC_MESSAGES/django.po +2 -2
  55. wagtail/locales/locale/tr_TR/LC_MESSAGES/django.po +2 -2
  56. wagtail/locales/locale/zh_Hans/LC_MESSAGES/django.po +2 -2
  57. wagtail/locales/locale/zh_Hant/LC_MESSAGES/django.po +2 -2
  58. wagtail/models/__init__.py +1 -1
  59. wagtail/search/backends/base.py +6 -5
  60. wagtail/search/backends/database/fallback.py +3 -0
  61. wagtail/search/backends/database/mysql/mysql.py +3 -0
  62. wagtail/search/backends/database/postgres/postgres.py +3 -0
  63. wagtail/search/backends/database/sqlite/sqlite.py +3 -0
  64. wagtail/search/backends/elasticsearch7.py +3 -0
  65. wagtail/search/signal_handlers.py +1 -1
  66. wagtail/search/tests/test_backends.py +7 -0
  67. wagtail/search/tests/test_index_functions.py +27 -1
  68. wagtail/signal_handlers.py +1 -1
  69. wagtail/test/testapp/migrations/0046_advertwithcustomuuidprimarykey_page.py +25 -0
  70. wagtail/test/testapp/models.py +7 -1
  71. wagtail/tests/test_reference_index.py +13 -0
  72. wagtail/users/locale/fi/LC_MESSAGES/django.po +2 -2
  73. wagtail-6.4.1.dist-info/METADATA +77 -0
  74. {wagtail-6.4.dist-info → wagtail-6.4.1.dist-info}/RECORD +78 -77
  75. {wagtail-6.4.dist-info → wagtail-6.4.1.dist-info}/WHEEL +1 -1
  76. wagtail-6.4.dist-info/METADATA +0 -77
  77. {wagtail-6.4.dist-info → wagtail-6.4.1.dist-info}/LICENSE +0 -0
  78. {wagtail-6.4.dist-info → wagtail-6.4.1.dist-info}/entry_points.txt +0 -0
  79. {wagtail-6.4.dist-info → wagtail-6.4.1.dist-info}/top_level.txt +0 -0
@@ -56,6 +56,9 @@ class DatabaseSearchQueryCompiler(BaseSearchQueryCompiler):
56
56
  **{field.get_attname(self.queryset.model) + "__" + lookup: value}
57
57
  )
58
58
 
59
+ def _process_match_none(self):
60
+ return models.Q(pk__in=[])
61
+
59
62
  def _connect_filters(self, filters, connector, negated):
60
63
  if connector == "AND":
61
64
  q = models.Q(*filters)
@@ -522,6 +522,9 @@ class MySQLSearchQueryCompiler(BaseSearchQueryCompiler):
522
522
  lhs = field.get_attname(self.queryset.model) + "__" + lookup
523
523
  return Q(**{lhs: value})
524
524
 
525
+ def _process_match_none(self):
526
+ return Q(pk__in=[])
527
+
525
528
  def _connect_filters(self, filters, connector, negated):
526
529
  if connector == "AND":
527
530
  q = Q(*filters)
@@ -561,6 +561,9 @@ class PostgresSearchQueryCompiler(BaseSearchQueryCompiler):
561
561
  lhs = field.get_attname(self.queryset.model) + "__" + lookup
562
562
  return Q(**{lhs: value})
563
563
 
564
+ def _process_match_none(self):
565
+ return Q(pk__in=[])
566
+
564
567
  def _connect_filters(self, filters, connector, negated):
565
568
  if connector == "AND":
566
569
  q = Q(*filters)
@@ -580,6 +580,9 @@ class SQLiteSearchQueryCompiler(BaseSearchQueryCompiler):
580
580
  lhs = field.get_attname(self.queryset.model) + "__" + lookup
581
581
  return Q(**{lhs: value})
582
582
 
583
+ def _process_match_none(self):
584
+ return Q(pk__in=[])
585
+
583
586
  def _connect_filters(self, filters, connector, negated):
584
587
  if connector == "AND":
585
588
  q = Q(*filters)
@@ -565,6 +565,9 @@ class Elasticsearch7SearchQueryCompiler(BaseSearchQueryCompiler):
565
565
  }
566
566
  }
567
567
 
568
+ def _process_match_none(self):
569
+ return {"bool": {"mustNot": {"match_all": {}}}}
570
+
568
571
  def _connect_filters(self, filters, connector, negated):
569
572
  if filters:
570
573
  if len(filters) == 1:
@@ -6,7 +6,7 @@ from .tasks import insert_or_update_object_task
6
6
 
7
7
  def post_save_signal_handler(instance, **kwargs):
8
8
  insert_or_update_object_task.enqueue(
9
- instance._meta.app_label, instance._meta.model_name, instance.pk
9
+ instance._meta.app_label, instance._meta.model_name, str(instance.pk)
10
10
  )
11
11
 
12
12
 
@@ -638,6 +638,13 @@ class BackendTests(WagtailTestUtils):
638
638
  ],
639
639
  )
640
640
 
641
+ def test_filter_none(self):
642
+ results = self.backend.search(MATCH_ALL, models.Book.objects.none())
643
+ self.assertListEqual(list(results), [])
644
+
645
+ results = self.backend.search("JavaScript", models.Book.objects.none())
646
+ self.assertListEqual(list(results), [])
647
+
641
648
  # FACET TESTS
642
649
 
643
650
  def test_facet(self):
@@ -6,7 +6,7 @@ from django.test import TestCase, override_settings
6
6
  from wagtail.models import Page
7
7
  from wagtail.search import index
8
8
  from wagtail.test.search import models
9
- from wagtail.test.testapp.models import SimplePage
9
+ from wagtail.test.testapp.models import AdvertWithCustomUUIDPrimaryKey, SimplePage
10
10
  from wagtail.test.utils import WagtailTestUtils
11
11
 
12
12
 
@@ -166,6 +166,12 @@ class TestSignalHandlers(WagtailTestUtils, TestCase):
166
166
  )
167
167
  backend().add.assert_called_with(obj)
168
168
 
169
+ def test_index_on_create_with_uuid_primary_key(self, backend):
170
+ backend().reset_mock()
171
+ with self.captureOnCommitCallbacks(execute=True):
172
+ obj = AdvertWithCustomUUIDPrimaryKey.objects.create(text="Test")
173
+ backend().add.assert_called_with(obj)
174
+
169
175
  def test_index_on_update(self, backend):
170
176
  obj = models.Book.objects.create(
171
177
  title="Test", publication_date=date(2017, 10, 18), number_of_pages=100
@@ -180,6 +186,18 @@ class TestSignalHandlers(WagtailTestUtils, TestCase):
180
186
  indexed_object = backend().add.call_args[0][0]
181
187
  self.assertEqual(indexed_object.title, "Updated test")
182
188
 
189
+ def test_index_on_update_with_uuid_primary_key(self, backend):
190
+ obj = AdvertWithCustomUUIDPrimaryKey.objects.create(text="Test")
191
+
192
+ backend().reset_mock()
193
+ obj.text = "Updated test"
194
+ with self.captureOnCommitCallbacks(execute=True):
195
+ obj.save()
196
+
197
+ self.assertEqual(backend().add.call_count, 1)
198
+ indexed_object = backend().add.call_args[0][0]
199
+ self.assertEqual(indexed_object.text, "Updated test")
200
+
183
201
  def test_index_on_delete(self, backend):
184
202
  obj = models.Book.objects.create(
185
203
  title="Test", publication_date=date(2017, 10, 18), number_of_pages=100
@@ -190,6 +208,14 @@ class TestSignalHandlers(WagtailTestUtils, TestCase):
190
208
  obj.delete()
191
209
  backend().delete.assert_called_with(obj)
192
210
 
211
+ def test_index_on_delete_with_uuid_primary_key(self, backend):
212
+ obj = AdvertWithCustomUUIDPrimaryKey.objects.create(text="Test")
213
+
214
+ backend().reset_mock()
215
+ with self.captureOnCommitCallbacks(execute=True):
216
+ obj.delete()
217
+ backend().delete.assert_called_with(obj)
218
+
193
219
  def test_do_not_index_fields_omitted_from_update_fields(self, backend):
194
220
  obj = models.Book.objects.create(
195
221
  title="Test", publication_date=date(2017, 10, 18), number_of_pages=100
@@ -72,7 +72,7 @@ def update_reference_index_on_save(instance, **kwargs):
72
72
  return
73
73
 
74
74
  update_reference_index_task.enqueue(
75
- instance._meta.app_label, instance._meta.model_name, instance.pk
75
+ instance._meta.app_label, instance._meta.model_name, str(instance.pk)
76
76
  )
77
77
 
78
78
 
@@ -0,0 +1,25 @@
1
+ # Generated by Django 5.1.5 on 2025-02-13 01:36
2
+
3
+ import django.db.models.deletion
4
+ from django.db import migrations, models
5
+
6
+
7
+ class Migration(migrations.Migration):
8
+
9
+ dependencies = [
10
+ ("tests", "0045_alter_streampage_body"),
11
+ ("wagtailcore", "0094_alter_page_locale"),
12
+ ]
13
+
14
+ operations = [
15
+ migrations.AddField(
16
+ model_name="advertwithcustomuuidprimarykey",
17
+ name="page",
18
+ field=models.ForeignKey(
19
+ blank=True,
20
+ null=True,
21
+ on_delete=django.db.models.deletion.SET_NULL,
22
+ to="wagtailcore.page",
23
+ ),
24
+ ),
25
+ ]
@@ -1006,14 +1006,20 @@ class AdvertWithCustomPrimaryKey(ClusterableModel):
1006
1006
  register_snippet(AdvertWithCustomPrimaryKey)
1007
1007
 
1008
1008
 
1009
- class AdvertWithCustomUUIDPrimaryKey(ClusterableModel):
1009
+ class AdvertWithCustomUUIDPrimaryKey(index.Indexed, ClusterableModel):
1010
1010
  advert_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
1011
1011
  url = models.URLField(null=True, blank=True)
1012
1012
  text = models.CharField(max_length=255)
1013
+ page = models.ForeignKey(Page, null=True, blank=True, on_delete=models.SET_NULL)
1013
1014
 
1014
1015
  panels = [
1015
1016
  FieldPanel("url"),
1016
1017
  FieldPanel("text"),
1018
+ FieldPanel("page"),
1019
+ ]
1020
+
1021
+ search_fields = [
1022
+ index.SearchField("text"),
1017
1023
  ]
1018
1024
 
1019
1025
  def __str__(self):
@@ -250,6 +250,19 @@ class TestCreateOrUpdateForObject(TestCase):
250
250
  refs = ReferenceIndex.get_references_to(content_type)
251
251
  self.assertEqual(refs.count(), 0)
252
252
 
253
+ def test_model_with_uuid_primary_key(self):
254
+ refs = ReferenceIndex.get_references_to(self.event_page)
255
+ self.assertEqual(refs.count(), 0)
256
+
257
+ with self.captureOnCommitCallbacks(execute=True):
258
+ AdvertWithCustomUUIDPrimaryKey.objects.create(
259
+ text="An advertisement",
260
+ page=self.event_page,
261
+ )
262
+
263
+ refs = ReferenceIndex.get_references_to(self.event_page)
264
+ self.assertEqual(refs.count(), 1)
265
+
253
266
  def test_rebuild_references_index_no_verbosity(self):
254
267
  stdout = StringIO()
255
268
  management.call_command(
@@ -33,8 +33,8 @@ msgstr "Vaadittu. Vain kirjaimia, numeroita ja merkkejä @/./+/-/_."
33
33
 
34
34
  msgid "This value may contain only letters, numbers and @/./+/-/_ characters."
35
35
  msgstr ""
36
- "Arvo voi sisältää ainoastaan kirjaimia, numeroita ja @/./+/-/_ -"
37
- "erikoismerkkejä."
36
+ "Arvo voi sisältää ainoastaan kirjaimia, numeroita ja @/./+/-/_ "
37
+ "-erikoismerkkejä."
38
38
 
39
39
  msgid "A user with that username already exists."
40
40
  msgstr "Käyttäjä tällä käyttäjänimellä on jo olemassa."
@@ -0,0 +1,77 @@
1
+ Metadata-Version: 2.1
2
+ Name: wagtail
3
+ Version: 6.4.1
4
+ Summary: A Django content management system.
5
+ Home-page: https://wagtail.org/
6
+ Author: Wagtail core team + contributors
7
+ Author-email: hello@wagtail.org
8
+ License: BSD
9
+ Project-URL: Changelog, https://github.com/wagtail/wagtail/blob/main/CHANGELOG.txt
10
+ Project-URL: Documentation, https://docs.wagtail.org
11
+ Project-URL: Source, https://github.com/wagtail/wagtail
12
+ Project-URL: Tracker, https://github.com/wagtail/wagtail/issues
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Environment :: Web Environment
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: BSD License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Framework :: Django
26
+ Classifier: Framework :: Django :: 4.2
27
+ Classifier: Framework :: Django :: 5.0
28
+ Classifier: Framework :: Django :: 5.1
29
+ Classifier: Framework :: Wagtail
30
+ Classifier: Topic :: Internet :: WWW/HTTP :: Site Management
31
+ Requires-Python: >=3.9
32
+ License-File: LICENSE
33
+ Requires-Dist: Django<6.0,>=4.2
34
+ Requires-Dist: django-modelcluster<7.0,>=6.2.1
35
+ Requires-Dist: django-permissionedforms<1.0,>=0.1
36
+ Requires-Dist: django-taggit<7,>=5.0
37
+ Requires-Dist: django-treebeard<5.0,>=4.5.1
38
+ Requires-Dist: djangorestframework<4.0,>=3.15.1
39
+ Requires-Dist: django-filter>=23.3
40
+ Requires-Dist: draftjs-exporter<6.0,>=2.1.5
41
+ Requires-Dist: Pillow<12.0.0,>=9.1.0
42
+ Requires-Dist: beautifulsoup4<5,>=4.8
43
+ Requires-Dist: Willow[heif]<2,>=1.8.0
44
+ Requires-Dist: requests<3.0,>=2.11.1
45
+ Requires-Dist: openpyxl<4.0,>=3.0.10
46
+ Requires-Dist: anyascii>=0.1.5
47
+ Requires-Dist: telepath<1,>=0.3.1
48
+ Requires-Dist: laces<0.2,>=0.1
49
+ Requires-Dist: django-tasks<0.7,>=0.6.1
50
+ Provides-Extra: docs
51
+ Requires-Dist: pyenchant<4,>=3.1.1; extra == "docs"
52
+ Requires-Dist: sphinxcontrib-spelling<8,>=7; extra == "docs"
53
+ Requires-Dist: Sphinx>=7.3; extra == "docs"
54
+ Requires-Dist: sphinx-autobuild>=0.6.0; extra == "docs"
55
+ Requires-Dist: sphinx-wagtail-theme==6.5.0; extra == "docs"
56
+ Requires-Dist: myst-parser==2.0.0; extra == "docs"
57
+ Provides-Extra: testing
58
+ Requires-Dist: python-dateutil>=2.7; extra == "testing"
59
+ Requires-Dist: Jinja2<3.2,>=3.0; extra == "testing"
60
+ Requires-Dist: boto3<2,>=1.28; extra == "testing"
61
+ Requires-Dist: freezegun>=0.3.8; extra == "testing"
62
+ Requires-Dist: azure-mgmt-cdn<13.0,>=12.0; extra == "testing"
63
+ Requires-Dist: azure-mgmt-frontdoor<1.1,>=1.0; extra == "testing"
64
+ Requires-Dist: django-pattern-library>=0.7; extra == "testing"
65
+ Requires-Dist: coverage>=3.7.0; extra == "testing"
66
+ Requires-Dist: doc8==0.8.1; extra == "testing"
67
+ Requires-Dist: ruff==0.1.5; extra == "testing"
68
+ Requires-Dist: semgrep==1.40.0; extra == "testing"
69
+ Requires-Dist: curlylint==0.13.1; extra == "testing"
70
+ Requires-Dist: djhtml==3.0.6; extra == "testing"
71
+ Requires-Dist: polib<2.0,>=1.1; extra == "testing"
72
+ Requires-Dist: factory-boy>=3.2; extra == "testing"
73
+ Requires-Dist: tblib<3.0,>=2.0; extra == "testing"
74
+
75
+ Wagtail is an open source content management system built on Django, with a strong community and commercial support. It’s focused on user experience, and offers precise control for designers and developers.
76
+
77
+ For more details, see https://wagtail.org, https://docs.wagtail.org and https://github.com/wagtail/wagtail/.