wagtail 7.2.1__py3-none-any.whl → 7.3rc1__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.
- wagtail/__init__.py +1 -1
- wagtail/actions/copy_for_translation.py +4 -2
- wagtail/admin/action_menu.py +4 -1
- wagtail/admin/api/actions/convert_alias.py +2 -2
- wagtail/admin/api/actions/copy.py +2 -2
- wagtail/admin/api/actions/copy_for_translation.py +2 -2
- wagtail/admin/api/actions/create_alias.py +2 -2
- wagtail/admin/api/actions/delete.py +1 -1
- wagtail/admin/api/actions/move.py +1 -1
- wagtail/admin/api/actions/publish.py +2 -2
- wagtail/admin/api/actions/revert_to_page_revision.py +2 -2
- wagtail/admin/api/actions/unpublish.py +1 -1
- wagtail/admin/api/filters.py +2 -2
- wagtail/admin/compare.py +22 -0
- wagtail/admin/forms/account.py +52 -1
- wagtail/admin/forms/comments.py +53 -0
- wagtail/admin/forms/models.py +36 -0
- wagtail/admin/forms/pages.py +7 -0
- wagtail/admin/forms/workflows.py +5 -2
- wagtail/admin/icons.py +4 -3
- wagtail/admin/locale/ar/LC_MESSAGES/django.mo +0 -0
- wagtail/admin/locale/ar/LC_MESSAGES/django.po +35 -0
- wagtail/admin/locale/en/LC_MESSAGES/django.po +262 -234
- wagtail/admin/locale/en/LC_MESSAGES/djangojs.po +72 -43
- wagtail/admin/locale/it/LC_MESSAGES/django.mo +0 -0
- wagtail/admin/locale/it/LC_MESSAGES/django.po +566 -6
- wagtail/admin/locale/it/LC_MESSAGES/djangojs.mo +0 -0
- wagtail/admin/locale/it/LC_MESSAGES/djangojs.po +40 -2
- wagtail/admin/locale/nl/LC_MESSAGES/django.mo +0 -0
- wagtail/admin/locale/nl/LC_MESSAGES/django.po +2 -2
- wagtail/admin/locale/sv/LC_MESSAGES/django.mo +0 -0
- wagtail/admin/locale/sv/LC_MESSAGES/django.po +330 -15
- wagtail/admin/locale/sv/LC_MESSAGES/djangojs.mo +0 -0
- wagtail/admin/locale/sv/LC_MESSAGES/djangojs.po +3 -2
- wagtail/admin/panels/comment_panel.py +1 -51
- wagtail/admin/panels/title_field_panel.py +3 -1
- wagtail/admin/static/wagtailadmin/css/core.css +1 -1
- wagtail/admin/static/wagtailadmin/js/bulk-actions.js +1 -1
- wagtail/admin/static/wagtailadmin/js/comments.js +1 -1
- wagtail/admin/static/wagtailadmin/js/core.js +1 -1
- wagtail/admin/static/wagtailadmin/js/core.js.LICENSE.txt +1 -1
- wagtail/admin/static/wagtailadmin/js/draftail.js +1 -1
- wagtail/admin/static/wagtailadmin/js/privacy-switch.js +1 -1
- wagtail/admin/static/wagtailadmin/js/sidebar.js +1 -1
- wagtail/admin/static/wagtailadmin/js/telepath/blocks.js +1 -1
- wagtail/admin/static/wagtailadmin/js/userbar.js +1 -1
- wagtail/admin/static/wagtailadmin/js/userbar.js.LICENSE.txt +1 -1
- wagtail/admin/static/wagtailadmin/js/vendor.js +1 -1
- wagtail/admin/static/wagtailadmin/js/wagtailadmin.js +1 -1
- wagtail/admin/templates/wagtailadmin/base.html +1 -1
- wagtail/admin/templates/wagtailadmin/generic/edit_partials.html +100 -0
- wagtail/admin/templates/wagtailadmin/generic/form.html +26 -5
- wagtail/admin/templates/wagtailadmin/generic/includes/_loaded_revision_inputs.html +3 -0
- wagtail/admin/templates/wagtailadmin/generic/listing_results.html +1 -17
- wagtail/admin/templates/wagtailadmin/pages/create.html +14 -4
- wagtail/admin/templates/wagtailadmin/pages/edit.html +16 -3
- wagtail/admin/templates/wagtailadmin/pages/edit_partials.html +31 -0
- wagtail/admin/templates/wagtailadmin/pages/index_results.html +1 -9
- wagtail/admin/templates/wagtailadmin/shared/autosave/indicator.html +36 -0
- wagtail/admin/templates/wagtailadmin/shared/breadcrumbs.html +1 -1
- wagtail/admin/templates/wagtailadmin/shared/editing_sessions/list.html +2 -2
- wagtail/admin/templates/wagtailadmin/shared/editing_sessions/module.html +19 -3
- wagtail/admin/templates/wagtailadmin/shared/headers/_actions.html +5 -0
- wagtail/admin/templates/wagtailadmin/shared/headers/_history_icon_link.html +2 -2
- wagtail/admin/templates/wagtailadmin/shared/headers/slim_header.html +8 -9
- wagtail/admin/templates/wagtailadmin/shared/listing/filter_partials.html +19 -0
- wagtail/admin/templates/wagtailadmin/shared/side_panel_toggle.html +3 -3
- wagtail/admin/templates/wagtailadmin/shared/side_panels/includes/side_panel.html +3 -0
- wagtail/admin/templates/wagtailadmin/shared/side_panels/includes/status/privacy.html +18 -6
- wagtail/admin/templates/wagtailadmin/shared/side_panels/includes/status/usage.html +11 -4
- wagtail/admin/templates/wagtailadmin/shared/side_panels/includes/status/workflow.html +22 -1
- wagtail/admin/templates/wagtailadmin/shared/side_panels/preview.html +1 -0
- wagtail/admin/templates/wagtailadmin/shared/side_panels.html +1 -2
- wagtail/admin/templates/wagtailadmin/shared/unsaved_changes_warning.html +20 -20
- wagtail/admin/templates/wagtailadmin/userbar/base.html +2 -0
- wagtail/admin/templates/wagtailadmin/userbar/item_accessibility.html +1 -1
- wagtail/admin/templatetags/wagtailadmin_tags.py +6 -14
- wagtail/admin/tests/pages/test_create_page.py +298 -1
- wagtail/admin/tests/pages/test_custom_listing.py +48 -2
- wagtail/admin/tests/pages/test_edit_page.py +721 -7
- wagtail/admin/tests/pages/test_explorer_view.py +9 -5
- wagtail/admin/tests/pages/test_page_search.py +15 -0
- wagtail/admin/tests/pages/test_revisions.py +4 -0
- wagtail/admin/tests/test_account_management.py +88 -2
- wagtail/admin/tests/test_collections_views.py +15 -15
- wagtail/admin/tests/test_compare.py +34 -0
- wagtail/admin/tests/test_editing_sessions.py +230 -8
- wagtail/admin/tests/test_forms.py +192 -1
- wagtail/admin/tests/test_icon_sprite.py +22 -2
- wagtail/admin/tests/test_page_chooser.py +13 -13
- wagtail/admin/tests/test_reports_views.py +4 -1
- wagtail/admin/tests/test_userbar.py +69 -5
- wagtail/admin/tests/test_views_generic.py +5 -5
- wagtail/admin/tests/test_workflows.py +14 -12
- wagtail/admin/tests/viewsets/test_model_viewset.py +13 -0
- wagtail/admin/ui/autosave.py +5 -0
- wagtail/admin/ui/editing_sessions.py +3 -0
- wagtail/admin/ui/side_panels.py +19 -20
- wagtail/admin/userbar.py +48 -27
- wagtail/admin/views/bulk_action/dispatcher.py +2 -2
- wagtail/admin/views/chooser.py +6 -6
- wagtail/admin/views/editing_sessions.py +20 -7
- wagtail/admin/views/generic/__init__.py +1 -0
- wagtail/admin/views/generic/chooser.py +5 -5
- wagtail/admin/views/generic/mixins.py +143 -26
- wagtail/admin/views/generic/models.py +157 -27
- wagtail/admin/views/generic/ordering.py +1 -1
- wagtail/admin/views/generic/preview.py +4 -4
- wagtail/admin/views/home.py +3 -1
- wagtail/admin/views/pages/create.py +77 -29
- wagtail/admin/views/pages/edit.py +160 -34
- wagtail/admin/views/pages/preview.py +4 -4
- wagtail/admin/views/pages/revisions.py +3 -0
- wagtail/admin/views/pages/search.py +4 -4
- wagtail/admin/views/pages/usage.py +2 -2
- wagtail/admin/views/tags.py +2 -2
- wagtail/admin/views/workflows.py +73 -54
- wagtail/admin/viewsets/model.py +34 -8
- wagtail/admin/widgets/button.py +11 -4
- wagtail/admin/widgets/chooser.py +6 -4
- wagtail/admin/widgets/slug.py +1 -1
- wagtail/api/v2/filters.py +27 -21
- wagtail/api/v2/pagination.py +4 -4
- wagtail/api/v2/views.py +7 -7
- wagtail/blocks/list_block.py +0 -8
- wagtail/blocks/migrations/migrate_operation.py +8 -1
- wagtail/blocks/stream_block.py +2 -10
- wagtail/blocks/struct_block.py +192 -12
- wagtail/compat.py +2 -2
- wagtail/contrib/forms/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/forms/locale/it/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/it/LC_MESSAGES/django.po +40 -2
- wagtail/contrib/frontend_cache/backends/azure.py +6 -6
- wagtail/contrib/frontend_cache/backends/cloudfront.py +2 -2
- wagtail/contrib/frontend_cache/utils.py +1 -1
- wagtail/contrib/redirects/forms.py +1 -1
- wagtail/contrib/redirects/locale/en/LC_MESSAGES/django.po +14 -14
- wagtail/contrib/redirects/locale/it/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/redirects/locale/it/LC_MESSAGES/django.po +15 -2
- wagtail/contrib/redirects/locale/sv/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/redirects/locale/sv/LC_MESSAGES/django.po +16 -3
- wagtail/contrib/redirects/middleware.py +11 -7
- wagtail/contrib/redirects/models.py +17 -1
- wagtail/contrib/redirects/tests/test_import_admin_views.py +3 -3
- wagtail/contrib/redirects/tests/test_redirects.py +56 -8
- wagtail/contrib/search_promotions/locale/en/LC_MESSAGES/django.po +6 -6
- wagtail/contrib/search_promotions/locale/it/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/search_promotions/locale/it/LC_MESSAGES/django.po +43 -2
- wagtail/contrib/search_promotions/tests.py +1 -1
- wagtail/contrib/search_promotions/views/settings.py +24 -25
- wagtail/contrib/settings/jinja2tags.py +2 -2
- wagtail/contrib/settings/locale/en/LC_MESSAGES/django.po +2 -2
- wagtail/contrib/settings/locale/it/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/settings/locale/it/LC_MESSAGES/django.po +6 -2
- wagtail/contrib/settings/locale/sv/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/settings/locale/sv/LC_MESSAGES/django.po +3 -2
- wagtail/contrib/settings/tests/generic/test_admin.py +118 -2
- wagtail/contrib/settings/tests/site_specific/test_admin.py +78 -15
- wagtail/contrib/settings/tests/site_specific/test_model.py +2 -2
- wagtail/contrib/settings/views.py +7 -0
- wagtail/contrib/simple_translation/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/simple_translation/locale/it/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/simple_translation/locale/it/LC_MESSAGES/django.po +5 -2
- wagtail/contrib/styleguide/locale/en/LC_MESSAGES/django.po +7 -7
- wagtail/contrib/styleguide/tests.py +2 -0
- wagtail/contrib/styleguide/views.py +4 -5
- wagtail/contrib/table_block/locale/ar/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/table_block/locale/ar/LC_MESSAGES/django.po +5 -1
- wagtail/contrib/table_block/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/table_block/locale/it/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/table_block/locale/it/LC_MESSAGES/django.po +5 -2
- wagtail/contrib/typed_table_block/blocks.py +37 -0
- wagtail/contrib/typed_table_block/locale/en/LC_MESSAGES/django.po +10 -10
- wagtail/contrib/typed_table_block/locale/sv/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/typed_table_block/locale/sv/LC_MESSAGES/django.po +4 -3
- wagtail/contrib/typed_table_block/tests.py +108 -0
- wagtail/coreutils.py +4 -4
- wagtail/documents/__init__.py +4 -4
- wagtail/documents/locale/en/LC_MESSAGES/django.po +15 -15
- wagtail/documents/locale/it/LC_MESSAGES/django.mo +0 -0
- wagtail/documents/locale/it/LC_MESSAGES/django.po +32 -2
- wagtail/documents/locale/sv/LC_MESSAGES/django.mo +0 -0
- wagtail/documents/locale/sv/LC_MESSAGES/django.po +32 -4
- wagtail/documents/models.py +1 -1
- wagtail/documents/tests/test_admin_views.py +19 -4
- wagtail/documents/tests/test_search.py +0 -2
- wagtail/documents/tests/test_views.py +6 -4
- wagtail/documents/views/bulk_actions/add_tags.py +1 -1
- wagtail/embeds/finders/facebook.py +3 -3
- wagtail/embeds/finders/instagram.py +3 -3
- wagtail/embeds/finders/oembed.py +7 -2
- wagtail/embeds/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/embeds/oembed_providers.py +8 -0
- wagtail/embeds/tests/test_embeds.py +35 -0
- wagtail/images/__init__.py +4 -4
- wagtail/images/admin_urls.py +3 -3
- wagtail/images/blocks.py +1 -1
- wagtail/images/formats.py +2 -2
- wagtail/images/image_operations.py +2 -2
- wagtail/images/locale/en/LC_MESSAGES/django.po +44 -40
- wagtail/images/locale/it/LC_MESSAGES/django.mo +0 -0
- wagtail/images/locale/it/LC_MESSAGES/django.po +50 -4
- wagtail/images/locale/nl/LC_MESSAGES/django.mo +0 -0
- wagtail/images/locale/nl/LC_MESSAGES/django.po +3 -3
- wagtail/images/locale/sv/LC_MESSAGES/django.mo +0 -0
- wagtail/images/locale/sv/LC_MESSAGES/django.po +49 -6
- wagtail/images/models.py +11 -10
- wagtail/images/templates/wagtailimages/images/index_results.html +1 -1
- wagtail/images/templates/wagtailimages/images/url_generator.html +17 -38
- wagtail/images/templates/wagtailimages/images/url_generator_output.html +28 -0
- wagtail/images/templatetags/wagtailimages_tags.py +4 -4
- wagtail/images/tests/test_admin_views.py +432 -59
- wagtail/images/tests/test_image_operations.py +2 -2
- wagtail/images/tests/test_models.py +0 -2
- wagtail/images/views/bulk_actions/add_tags.py +1 -1
- wagtail/images/views/images.py +72 -39
- wagtail/locale/en/LC_MESSAGES/django.po +103 -105
- wagtail/locale/it/LC_MESSAGES/django.mo +0 -0
- wagtail/locale/it/LC_MESSAGES/django.po +105 -2
- wagtail/locale/sv/LC_MESSAGES/django.mo +0 -0
- wagtail/locale/sv/LC_MESSAGES/django.po +95 -12
- wagtail/locales/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/locales/locale/it/LC_MESSAGES/django.mo +0 -0
- wagtail/locales/locale/it/LC_MESSAGES/django.po +13 -2
- wagtail/locales/locale/sv/LC_MESSAGES/django.mo +0 -0
- wagtail/locales/locale/sv/LC_MESSAGES/django.po +4 -3
- wagtail/locales/tests.py +5 -5
- wagtail/models/i18n.py +4 -6
- wagtail/models/media.py +18 -0
- wagtail/models/pages.py +65 -11
- wagtail/models/reference_index.py +15 -0
- wagtail/models/revisions.py +40 -12
- wagtail/models/workflows.py +0 -3
- wagtail/permission_policies/base.py +2 -2
- wagtail/permission_policies/collections.py +2 -2
- wagtail/project_template/requirements.txt +2 -2
- wagtail/search/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/signal_handlers.py +1 -0
- wagtail/sites/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/sites/locale/sv/LC_MESSAGES/django.mo +0 -0
- wagtail/sites/locale/sv/LC_MESSAGES/django.po +3 -2
- wagtail/sites/tests.py +7 -7
- wagtail/snippets/action_menu.py +2 -1
- wagtail/snippets/locale/en/LC_MESSAGES/django.po +23 -13
- wagtail/snippets/locale/sv/LC_MESSAGES/django.mo +0 -0
- wagtail/snippets/locale/sv/LC_MESSAGES/django.po +12 -1
- wagtail/snippets/tests/test_chooser_block.py +197 -0
- wagtail/snippets/tests/test_chooser_panel.py +149 -0
- wagtail/snippets/tests/test_chooser_views.py +375 -0
- wagtail/snippets/tests/test_chooser_widget.py +22 -0
- wagtail/snippets/tests/test_compare_revisions_view.py +167 -0
- wagtail/snippets/tests/test_copy_view.py +38 -0
- wagtail/snippets/tests/test_create_view.py +1159 -0
- wagtail/snippets/tests/test_delete_view.py +225 -0
- wagtail/snippets/tests/test_edit_view.py +2882 -0
- wagtail/snippets/tests/test_history_view.py +182 -0
- wagtail/snippets/tests/test_index_view.py +105 -0
- wagtail/snippets/tests/test_list_view.py +786 -0
- wagtail/snippets/tests/test_locking.py +28 -0
- wagtail/snippets/tests/test_permissions.py +167 -0
- wagtail/snippets/tests/test_preview.py +3 -3
- wagtail/snippets/tests/test_revert_view.py +343 -0
- wagtail/snippets/tests/test_snippet_models.py +112 -0
- wagtail/snippets/tests/test_unpublish_view.py +228 -0
- wagtail/snippets/tests/test_unschedule_view.py +151 -0
- wagtail/snippets/tests/test_viewset.py +38 -5
- wagtail/snippets/views/snippets.py +78 -30
- wagtail/snippets/widgets.py +2 -2
- wagtail/templatetags/wagtailcore_tags.py +2 -2
- wagtail/test/dummy_external_storage.py +1 -1
- wagtail/test/testapp/fixtures/test.json +22 -0
- wagtail/test/testapp/fixtures/test_empty.json +2 -0
- wagtail/test/testapp/fixtures/test_explorable_pages.json +10 -0
- wagtail/test/testapp/fixtures/test_specific.json +9 -0
- wagtail/test/testapp/migrations/0059_nopromotepage.py +25 -0
- wagtail/test/testapp/models.py +7 -0
- wagtail/test/testapp/views.py +5 -0
- wagtail/test/utils/page_tests.py +7 -7
- wagtail/test/utils/wagtail_factories/builder.py +2 -2
- wagtail/tests/streamfield_migrations/test_migrations.py +35 -0
- wagtail/tests/test_blocks.py +321 -61
- wagtail/tests/test_collection_model.py +12 -0
- wagtail/tests/test_page_model.py +190 -1
- wagtail/tests/test_page_privacy.py +5 -0
- wagtail/tests/test_reference_index.py +42 -0
- wagtail/tests/test_revision_model.py +118 -1
- wagtail/tests/test_utils.py +2 -2
- wagtail/users/locale/en/LC_MESSAGES/django.po +14 -14
- wagtail/users/locale/id_ID/LC_MESSAGES/django.mo +0 -0
- wagtail/users/locale/id_ID/LC_MESSAGES/django.po +6 -2
- wagtail/users/locale/it/LC_MESSAGES/django.mo +0 -0
- wagtail/users/locale/it/LC_MESSAGES/django.po +14 -2
- wagtail/users/locale/sv/LC_MESSAGES/django.mo +0 -0
- wagtail/users/locale/sv/LC_MESSAGES/django.po +48 -17
- wagtail/users/tests/test_admin_views.py +39 -25
- wagtail/users/utils.py +4 -1
- wagtail/users/views/groups.py +19 -5
- wagtail/users/wagtail_hooks.py +1 -1
- wagtail/utils/loading.py +2 -2
- wagtail-7.3rc1.data/data/AGENTS.md +21 -0
- wagtail-7.3rc1.data/data/CHANGELOG.txt +4941 -0
- wagtail-7.3rc1.data/data/CODE_OF_CONDUCT.md +71 -0
- wagtail-7.3rc1.data/data/CONTRIBUTORS.md +999 -0
- wagtail-7.3rc1.data/data/SPONSORS.md +55 -0
- {wagtail-7.2.1.dist-info → wagtail-7.3rc1.dist-info}/METADATA +6 -6
- {wagtail-7.2.1.dist-info → wagtail-7.3rc1.dist-info}/RECORD +310 -280
- {wagtail-7.2.1.dist-info → wagtail-7.3rc1.dist-info}/WHEEL +1 -1
- wagtail/images/static/wagtailimages/js/image-url-generator.js +0 -1
- wagtail/snippets/tests/test_snippets.py +0 -6377
- {wagtail-7.2.1.dist-info → wagtail-7.3rc1.dist-info}/entry_points.txt +0 -0
- {wagtail-7.2.1.dist-info → wagtail-7.3rc1.dist-info}/licenses/LICENSE +0 -0
- {wagtail-7.2.1.dist-info → wagtail-7.3rc1.dist-info}/top_level.txt +0 -0
|
@@ -58,8 +58,8 @@ def get_snippet_model_from_url_params(app_name, model_name):
|
|
|
58
58
|
"""
|
|
59
59
|
try:
|
|
60
60
|
model = apps.get_model(app_name, model_name)
|
|
61
|
-
except LookupError:
|
|
62
|
-
raise Http404
|
|
61
|
+
except LookupError as e:
|
|
62
|
+
raise Http404 from e
|
|
63
63
|
if model not in get_snippet_models():
|
|
64
64
|
# don't allow people to hack the URL to edit content types that aren't registered as snippets
|
|
65
65
|
raise Http404
|
|
@@ -235,10 +235,27 @@ class CreateView(generic.CreateEditViewOptionalFeaturesMixin, generic.CreateView
|
|
|
235
235
|
template_name = "wagtailsnippets/snippets/create.html"
|
|
236
236
|
|
|
237
237
|
def run_before_hook(self):
|
|
238
|
-
|
|
238
|
+
response = self.run_hook("before_create_snippet", self.request, self.model)
|
|
239
|
+
if response:
|
|
240
|
+
if self.expects_json_response and not self.response_is_json(response):
|
|
241
|
+
# Hook response is not suitable for a JSON response, so construct our own error response
|
|
242
|
+
return self.json_error_response(
|
|
243
|
+
"blocked_by_hook",
|
|
244
|
+
_("Request to create %(model_name)s was blocked by hook.")
|
|
245
|
+
% {"model_name": self.model._meta.verbose_name},
|
|
246
|
+
)
|
|
247
|
+
else:
|
|
248
|
+
return response
|
|
239
249
|
|
|
240
250
|
def run_after_hook(self):
|
|
241
|
-
|
|
251
|
+
response = self.run_hook("after_create_snippet", self.request, self.object)
|
|
252
|
+
if response:
|
|
253
|
+
if self.expects_json_response and not self.response_is_json(response):
|
|
254
|
+
# Hook response is not suitable for a JSON response, so ignore it and just use
|
|
255
|
+
# the standard one
|
|
256
|
+
return None
|
|
257
|
+
else:
|
|
258
|
+
return response
|
|
242
259
|
|
|
243
260
|
def _get_action_menu(self):
|
|
244
261
|
return SnippetActionMenu(self.request, view=self.view_name, model=self.model)
|
|
@@ -253,9 +270,15 @@ class CreateView(generic.CreateEditViewOptionalFeaturesMixin, generic.CreateView
|
|
|
253
270
|
),
|
|
254
271
|
locale=self.locale,
|
|
255
272
|
translations=self.translations,
|
|
273
|
+
# Show skeleton for usage info if usage_url_name is set
|
|
274
|
+
usage_url="" if self.usage_url_name else None,
|
|
256
275
|
)
|
|
257
276
|
]
|
|
258
|
-
if
|
|
277
|
+
if (
|
|
278
|
+
not self.expects_json_response
|
|
279
|
+
and self.preview_enabled
|
|
280
|
+
and self.form.instance.is_previewable()
|
|
281
|
+
):
|
|
259
282
|
side_panels.append(
|
|
260
283
|
PreviewSidePanel(
|
|
261
284
|
self.form.instance, self.request, preview_url=self.get_preview_url()
|
|
@@ -276,15 +299,35 @@ class CopyView(generic.CopyViewMixin, CreateView):
|
|
|
276
299
|
pass
|
|
277
300
|
|
|
278
301
|
|
|
279
|
-
class EditView(
|
|
302
|
+
class EditView(
|
|
303
|
+
generic.CreateEditViewOptionalFeaturesMixin,
|
|
304
|
+
generic.EditView,
|
|
305
|
+
):
|
|
280
306
|
view_name = "edit"
|
|
281
307
|
template_name = "wagtailsnippets/snippets/edit.html"
|
|
282
308
|
|
|
283
309
|
def run_before_hook(self):
|
|
284
|
-
|
|
310
|
+
response = self.run_hook("before_edit_snippet", self.request, self.object)
|
|
311
|
+
if response:
|
|
312
|
+
if self.expects_json_response and not self.response_is_json(response):
|
|
313
|
+
# Hook response is not suitable for a JSON response, so construct our own error response
|
|
314
|
+
return self.json_error_response(
|
|
315
|
+
"blocked_by_hook",
|
|
316
|
+
_("Request to edit %(model_name)s was blocked by hook.")
|
|
317
|
+
% {"model_name": self.model._meta.verbose_name},
|
|
318
|
+
)
|
|
319
|
+
else:
|
|
320
|
+
return response
|
|
285
321
|
|
|
286
322
|
def run_after_hook(self):
|
|
287
|
-
|
|
323
|
+
response = self.run_hook("after_edit_snippet", self.request, self.object)
|
|
324
|
+
if response:
|
|
325
|
+
if self.expects_json_response and not self.response_is_json(response):
|
|
326
|
+
# Hook response is not suitable for a JSON response, so ignore it and just use
|
|
327
|
+
# the standard one
|
|
328
|
+
return None
|
|
329
|
+
else:
|
|
330
|
+
return response
|
|
288
331
|
|
|
289
332
|
def _get_action_menu(self):
|
|
290
333
|
return SnippetActionMenu(
|
|
@@ -313,7 +356,11 @@ class EditView(generic.CreateEditViewOptionalFeaturesMixin, generic.EditView):
|
|
|
313
356
|
last_updated_info=self.get_last_updated_info(),
|
|
314
357
|
)
|
|
315
358
|
]
|
|
316
|
-
if
|
|
359
|
+
if (
|
|
360
|
+
not self.expects_json_response
|
|
361
|
+
and self.preview_enabled
|
|
362
|
+
and self.object.is_previewable()
|
|
363
|
+
):
|
|
317
364
|
side_panels.append(
|
|
318
365
|
PreviewSidePanel(
|
|
319
366
|
self.object, self.request, preview_url=self.get_preview_url()
|
|
@@ -1044,16 +1091,17 @@ class SnippetViewSet(ModelViewSet):
|
|
|
1044
1091
|
)
|
|
1045
1092
|
|
|
1046
1093
|
def get_urlpatterns(self):
|
|
1094
|
+
conv = self.pk_path_converter
|
|
1047
1095
|
urlpatterns = [
|
|
1048
1096
|
path("", self.index_view, name="list"),
|
|
1049
1097
|
path("results/", self.index_results_view, name="list_results"),
|
|
1050
1098
|
path("add/", self.add_view, name="add"),
|
|
1051
|
-
path("edit/<
|
|
1052
|
-
path("delete/<
|
|
1053
|
-
path("usage/<
|
|
1054
|
-
path("history/<
|
|
1099
|
+
path(f"edit/<{conv}:pk>/", self.edit_view, name="edit"),
|
|
1100
|
+
path(f"delete/<{conv}:pk>/", self.delete_view, name="delete"),
|
|
1101
|
+
path(f"usage/<{conv}:pk>/", self.usage_view, name="usage"),
|
|
1102
|
+
path(f"history/<{conv}:pk>/", self.history_view, name="history"),
|
|
1055
1103
|
path(
|
|
1056
|
-
"history-results/<
|
|
1104
|
+
f"history-results/<{conv}:pk>/",
|
|
1057
1105
|
self.history_results_view,
|
|
1058
1106
|
name="history_results",
|
|
1059
1107
|
),
|
|
@@ -1061,22 +1109,22 @@ class SnippetViewSet(ModelViewSet):
|
|
|
1061
1109
|
|
|
1062
1110
|
if self.reorder_view_enabled:
|
|
1063
1111
|
urlpatterns += [
|
|
1064
|
-
path("reorder/<
|
|
1112
|
+
path(f"reorder/<{conv}:pk>/", self.reorder_view, name="reorder")
|
|
1065
1113
|
]
|
|
1066
1114
|
|
|
1067
1115
|
if self.copy_view_enabled:
|
|
1068
|
-
urlpatterns += [path("copy/<
|
|
1116
|
+
urlpatterns += [path(f"copy/<{conv}:pk>/", self.copy_view, name="copy")]
|
|
1069
1117
|
|
|
1070
1118
|
if self.inspect_view_enabled:
|
|
1071
1119
|
urlpatterns += [
|
|
1072
|
-
path("inspect/<
|
|
1120
|
+
path(f"inspect/<{conv}:pk>/", self.inspect_view, name="inspect")
|
|
1073
1121
|
]
|
|
1074
1122
|
|
|
1075
1123
|
if self.preview_enabled:
|
|
1076
1124
|
urlpatterns += [
|
|
1077
1125
|
path("preview/", self.preview_on_add_view, name="preview_on_add"),
|
|
1078
1126
|
path(
|
|
1079
|
-
"preview/<
|
|
1127
|
+
f"preview/<{conv}:pk>/",
|
|
1080
1128
|
self.preview_on_edit_view,
|
|
1081
1129
|
name="preview_on_edit",
|
|
1082
1130
|
),
|
|
@@ -1086,7 +1134,7 @@ class SnippetViewSet(ModelViewSet):
|
|
|
1086
1134
|
if self.preview_enabled:
|
|
1087
1135
|
urlpatterns += [
|
|
1088
1136
|
path(
|
|
1089
|
-
"history/<
|
|
1137
|
+
f"history/<{conv}:pk>/revisions/<int:revision_id>/view/",
|
|
1090
1138
|
self.revisions_view,
|
|
1091
1139
|
name="revisions_view",
|
|
1092
1140
|
)
|
|
@@ -1094,7 +1142,7 @@ class SnippetViewSet(ModelViewSet):
|
|
|
1094
1142
|
|
|
1095
1143
|
urlpatterns += [
|
|
1096
1144
|
path(
|
|
1097
|
-
"history/<
|
|
1145
|
+
f"history/<{conv}:pk>/revisions/<int:revision_id>/revert/",
|
|
1098
1146
|
self.revisions_revert_view,
|
|
1099
1147
|
name="revisions_revert",
|
|
1100
1148
|
),
|
|
@@ -1108,43 +1156,43 @@ class SnippetViewSet(ModelViewSet):
|
|
|
1108
1156
|
if self.draftstate_enabled:
|
|
1109
1157
|
urlpatterns += [
|
|
1110
1158
|
path(
|
|
1111
|
-
"history/<
|
|
1159
|
+
f"history/<{conv}:pk>/revisions/<int:revision_id>/unschedule/",
|
|
1112
1160
|
self.revisions_unschedule_view,
|
|
1113
1161
|
name="revisions_unschedule",
|
|
1114
1162
|
),
|
|
1115
|
-
path("unpublish/<
|
|
1163
|
+
path(f"unpublish/<{conv}:pk>/", self.unpublish_view, name="unpublish"),
|
|
1116
1164
|
]
|
|
1117
1165
|
|
|
1118
1166
|
if self.locking_enabled:
|
|
1119
1167
|
urlpatterns += [
|
|
1120
|
-
path("lock/<
|
|
1121
|
-
path("unlock/<
|
|
1168
|
+
path(f"lock/<{conv}:pk>/", self.lock_view, name="lock"),
|
|
1169
|
+
path(f"unlock/<{conv}:pk>/", self.unlock_view, name="unlock"),
|
|
1122
1170
|
]
|
|
1123
1171
|
|
|
1124
1172
|
if self.workflow_enabled:
|
|
1125
1173
|
urlpatterns += [
|
|
1126
1174
|
path(
|
|
1127
|
-
"workflow/action/<
|
|
1175
|
+
f"workflow/action/<{conv}:pk>/<slug:action_name>/<int:task_state_id>/",
|
|
1128
1176
|
self.workflow_action_view,
|
|
1129
1177
|
name="workflow_action",
|
|
1130
1178
|
),
|
|
1131
1179
|
path(
|
|
1132
|
-
"workflow/collect_action_data/<
|
|
1180
|
+
f"workflow/collect_action_data/<{conv}:pk>/<slug:action_name>/<int:task_state_id>/",
|
|
1133
1181
|
self.collect_workflow_action_data_view,
|
|
1134
1182
|
name="collect_workflow_action_data",
|
|
1135
1183
|
),
|
|
1136
1184
|
path(
|
|
1137
|
-
"workflow/confirm_cancellation/<
|
|
1185
|
+
f"workflow/confirm_cancellation/<{conv}:pk>/",
|
|
1138
1186
|
self.confirm_workflow_cancellation_view,
|
|
1139
1187
|
name="confirm_workflow_cancellation",
|
|
1140
1188
|
),
|
|
1141
1189
|
path(
|
|
1142
|
-
"workflow_history/<
|
|
1190
|
+
f"workflow_history/<{conv}:pk>/",
|
|
1143
1191
|
self.workflow_history_view,
|
|
1144
1192
|
name="workflow_history",
|
|
1145
1193
|
),
|
|
1146
1194
|
path(
|
|
1147
|
-
"workflow_history/<
|
|
1195
|
+
f"workflow_history/<{conv}:pk>/detail/<int:workflow_state_id>/",
|
|
1148
1196
|
self.workflow_history_detail_view,
|
|
1149
1197
|
name="workflow_history_detail",
|
|
1150
1198
|
),
|
|
@@ -1153,7 +1201,7 @@ class SnippetViewSet(ModelViewSet):
|
|
|
1153
1201
|
if self.preview_enabled:
|
|
1154
1202
|
urlpatterns += [
|
|
1155
1203
|
path(
|
|
1156
|
-
"workflow/preview/<
|
|
1204
|
+
f"workflow/preview/<{conv}:pk>/<int:task_id>/",
|
|
1157
1205
|
self.workflow_preview_view,
|
|
1158
1206
|
name="workflow_preview",
|
|
1159
1207
|
),
|
wagtail/snippets/widgets.py
CHANGED
|
@@ -33,7 +33,7 @@ class AdminSnippetChooser(BaseChooser):
|
|
|
33
33
|
return reverse(
|
|
34
34
|
self.model.snippet_viewset.chooser_viewset.get_url_name("choose")
|
|
35
35
|
)
|
|
36
|
-
except NoReverseMatch:
|
|
36
|
+
except NoReverseMatch as e:
|
|
37
37
|
# This most likely failed because the model is not registered as a snippet.
|
|
38
38
|
# Check whether this is the case, and if so, output a more helpful error message
|
|
39
39
|
from .models import get_snippet_models
|
|
@@ -42,7 +42,7 @@ class AdminSnippetChooser(BaseChooser):
|
|
|
42
42
|
raise ImproperlyConfigured(
|
|
43
43
|
"AdminSnippetChooser cannot be used on non-snippet model %r"
|
|
44
44
|
% self.model
|
|
45
|
-
)
|
|
45
|
+
) from e
|
|
46
46
|
else:
|
|
47
47
|
raise
|
|
48
48
|
|
|
@@ -177,10 +177,10 @@ def include_block(parser, token):
|
|
|
177
177
|
try:
|
|
178
178
|
tag_name = tokens.pop(0)
|
|
179
179
|
block_var_token = tokens.pop(0)
|
|
180
|
-
except IndexError:
|
|
180
|
+
except IndexError as e:
|
|
181
181
|
raise template.TemplateSyntaxError(
|
|
182
182
|
"%r tag requires at least one argument" % tag_name
|
|
183
|
-
)
|
|
183
|
+
) from e
|
|
184
184
|
|
|
185
185
|
block_var = parser.compile_filter(block_var_token)
|
|
186
186
|
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"content_type": ["wagtailcore", "page"],
|
|
30
30
|
"path": "0001",
|
|
31
31
|
"url_path": "/",
|
|
32
|
+
"locale_id": 1,
|
|
32
33
|
"slug": "root"
|
|
33
34
|
}
|
|
34
35
|
},
|
|
@@ -46,6 +47,7 @@
|
|
|
46
47
|
"content_type": ["wagtailcore", "page"],
|
|
47
48
|
"path": "00010001",
|
|
48
49
|
"url_path": "/home/",
|
|
50
|
+
"locale_id": 1,
|
|
49
51
|
"slug": "home",
|
|
50
52
|
"first_published_at": "2014-01-01T12:00:00.000Z",
|
|
51
53
|
"last_published_at": "2014-02-01T12:00:00.000Z"
|
|
@@ -63,6 +65,7 @@
|
|
|
63
65
|
"depth": 3,
|
|
64
66
|
"content_type": ["tests", "eventindex"],
|
|
65
67
|
"path": "000100010001",
|
|
68
|
+
"locale_id": 1,
|
|
66
69
|
"url_path": "/home/events/",
|
|
67
70
|
"slug": "events"
|
|
68
71
|
}
|
|
@@ -87,6 +90,7 @@
|
|
|
87
90
|
"depth": 4,
|
|
88
91
|
"content_type": ["tests", "eventpage"],
|
|
89
92
|
"path": "0001000100010001",
|
|
93
|
+
"locale_id": 1,
|
|
90
94
|
"url_path": "/home/events/christmas/",
|
|
91
95
|
"slug": "christmas",
|
|
92
96
|
"owner": 2
|
|
@@ -117,6 +121,7 @@
|
|
|
117
121
|
"depth": 4,
|
|
118
122
|
"content_type": ["tests", "singleeventpage"],
|
|
119
123
|
"path": "0001000100010005",
|
|
124
|
+
"locale_id": 1,
|
|
120
125
|
"url_path": "/home/events/saint-patrick/",
|
|
121
126
|
"slug": "saint-patrick",
|
|
122
127
|
"owner": 2
|
|
@@ -146,6 +151,7 @@
|
|
|
146
151
|
"model": "tests.eventpagespeaker",
|
|
147
152
|
"fields": {
|
|
148
153
|
"page": 4,
|
|
154
|
+
"locale_id": 1,
|
|
149
155
|
"first_name": "Father",
|
|
150
156
|
"last_name": "Christmas",
|
|
151
157
|
"sort_order": 0
|
|
@@ -164,6 +170,7 @@
|
|
|
164
170
|
"depth": 4,
|
|
165
171
|
"content_type": ["tests", "eventpage"],
|
|
166
172
|
"path": "0001000100010002",
|
|
173
|
+
"locale_id": 1,
|
|
167
174
|
"url_path": "/home/events/tentative-unpublished-event/",
|
|
168
175
|
"slug": "tentative-unpublished-event",
|
|
169
176
|
"owner": 2
|
|
@@ -193,6 +200,7 @@
|
|
|
193
200
|
"depth": 4,
|
|
194
201
|
"content_type": ["tests", "eventpage"],
|
|
195
202
|
"path": "0001000100010003",
|
|
203
|
+
"locale_id": 1,
|
|
196
204
|
"url_path": "/home/events/someone-elses-event/",
|
|
197
205
|
"slug": "someone-elses-event",
|
|
198
206
|
"owner": 3
|
|
@@ -222,6 +230,7 @@
|
|
|
222
230
|
"depth": 3,
|
|
223
231
|
"content_type": ["tests", "simplepage"],
|
|
224
232
|
"path": "000100010002",
|
|
233
|
+
"locale_id": 1,
|
|
225
234
|
"url_path": "/home/about-us/",
|
|
226
235
|
"slug": "about-us",
|
|
227
236
|
"first_published_at": "2014-01-01T12:00:00.000Z",
|
|
@@ -248,6 +257,7 @@
|
|
|
248
257
|
"depth": 3,
|
|
249
258
|
"content_type": ["tests", "formpage"],
|
|
250
259
|
"path": "000100010003",
|
|
260
|
+
"locale_id": 1,
|
|
251
261
|
"url_path": "/home/contact-us/",
|
|
252
262
|
"slug": "contact-us"
|
|
253
263
|
}
|
|
@@ -274,6 +284,7 @@
|
|
|
274
284
|
"depth": 4,
|
|
275
285
|
"content_type": ["tests", "eventpage"],
|
|
276
286
|
"path": "0001000100010004",
|
|
287
|
+
"locale_id": 1,
|
|
277
288
|
"url_path": "/home/events/final-event/",
|
|
278
289
|
"slug": "final-event",
|
|
279
290
|
"owner": 3
|
|
@@ -349,6 +360,7 @@
|
|
|
349
360
|
"depth": 3,
|
|
350
361
|
"content_type": ["tests", "pagewitholdstyleroutemethod"],
|
|
351
362
|
"path": "000100010004",
|
|
363
|
+
"locale_id": 1,
|
|
352
364
|
"url_path": "/home/old-style-route/",
|
|
353
365
|
"slug": "old-style-route"
|
|
354
366
|
}
|
|
@@ -373,6 +385,7 @@
|
|
|
373
385
|
"depth": 3,
|
|
374
386
|
"content_type": ["tests", "simplepage"],
|
|
375
387
|
"path": "000100010005",
|
|
388
|
+
"locale_id": 1,
|
|
376
389
|
"url_path": "/home/secret-plans/",
|
|
377
390
|
"slug": "secret-plans"
|
|
378
391
|
}
|
|
@@ -397,6 +410,7 @@
|
|
|
397
410
|
"depth": 4,
|
|
398
411
|
"content_type": ["tests", "eventpage"],
|
|
399
412
|
"path": "0001000100050001",
|
|
413
|
+
"locale_id": 1,
|
|
400
414
|
"url_path": "/home/secret-plans/steal-underpants/",
|
|
401
415
|
"slug": "steal-underpants"
|
|
402
416
|
}
|
|
@@ -424,6 +438,7 @@
|
|
|
424
438
|
"depth": 3,
|
|
425
439
|
"content_type": ["wagtailcore", "page"],
|
|
426
440
|
"path": "000100010006",
|
|
441
|
+
"locale_id": 1,
|
|
427
442
|
"url_path": "/home/my-locked-page/",
|
|
428
443
|
"slug": "my-locked-page",
|
|
429
444
|
"locked": true
|
|
@@ -441,6 +456,7 @@
|
|
|
441
456
|
"depth": 4,
|
|
442
457
|
"content_type": ["tests", "businessindex"],
|
|
443
458
|
"path": "0001000100010006",
|
|
459
|
+
"locale_id": 1,
|
|
444
460
|
"url_path": "/home/events/businessy-events/",
|
|
445
461
|
"slug": "businessy-events",
|
|
446
462
|
"owner": 2
|
|
@@ -464,6 +480,7 @@
|
|
|
464
480
|
"depth": 5,
|
|
465
481
|
"content_type": ["tests", "businesssubindex"],
|
|
466
482
|
"path": "00010001000100060001",
|
|
483
|
+
"locale_id": 1,
|
|
467
484
|
"url_path": "/home/events/businessy-events/board-meetings/",
|
|
468
485
|
"slug": "board-meetings",
|
|
469
486
|
"owner": 2
|
|
@@ -487,6 +504,7 @@
|
|
|
487
504
|
"depth": 3,
|
|
488
505
|
"content_type": ["tests", "formpagewithcustomsubmission"],
|
|
489
506
|
"path": "000100010007",
|
|
507
|
+
"locale_id": 1,
|
|
490
508
|
"url_path": "/home/contact-us-one-more-time/",
|
|
491
509
|
"slug": "contact-us-one-more-time"
|
|
492
510
|
}
|
|
@@ -583,6 +601,7 @@
|
|
|
583
601
|
"depth": 3,
|
|
584
602
|
"content_type": ["tests", "simplepage"],
|
|
585
603
|
"path": "000100010008",
|
|
604
|
+
"locale_id": 1,
|
|
586
605
|
"url_path": "/home/secret-event-editor-plans/",
|
|
587
606
|
"slug": "secret-event-editor-plans"
|
|
588
607
|
}
|
|
@@ -606,6 +625,7 @@
|
|
|
606
625
|
"depth": 3,
|
|
607
626
|
"content_type": ["tests", "simplepage"],
|
|
608
627
|
"path": "000100010009",
|
|
628
|
+
"locale_id": 1,
|
|
609
629
|
"url_path": "/home/secret-login-plans/",
|
|
610
630
|
"slug": "secret-login-plans"
|
|
611
631
|
}
|
|
@@ -629,6 +649,7 @@
|
|
|
629
649
|
"depth": 2,
|
|
630
650
|
"content_type": ["wagtailcore", "page"],
|
|
631
651
|
"path": "00010002",
|
|
652
|
+
"locale_id": 1,
|
|
632
653
|
"url_path": "/does-not-exist/",
|
|
633
654
|
"slug": "does-not-exist"
|
|
634
655
|
}
|
|
@@ -645,6 +666,7 @@
|
|
|
645
666
|
"depth": 3,
|
|
646
667
|
"content_type": ["tests", "pagewithexcludedcopyfield"],
|
|
647
668
|
"path": "000100010010",
|
|
669
|
+
"locale_id": 1,
|
|
648
670
|
"url_path": "/home/page-with-exclude-fields-in-copy/",
|
|
649
671
|
"slug": "page-with-exclude-fields-in-copy"
|
|
650
672
|
}
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"live": true,
|
|
28
28
|
"depth": 1,
|
|
29
29
|
"content_type": ["wagtailcore", "page"],
|
|
30
|
+
"locale_id": 1,
|
|
30
31
|
"path": "0001",
|
|
31
32
|
"url_path": "/",
|
|
32
33
|
"slug": "root"
|
|
@@ -44,6 +45,7 @@
|
|
|
44
45
|
"live": true,
|
|
45
46
|
"depth": 2,
|
|
46
47
|
"content_type": ["wagtailcore", "page"],
|
|
48
|
+
"locale_id": 1,
|
|
47
49
|
"path": "00010001",
|
|
48
50
|
"url_path": "/home/",
|
|
49
51
|
"slug": "home",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"content_type": ["wagtailcore", "page"],
|
|
13
13
|
"path": "0001",
|
|
14
14
|
"url_path": "/",
|
|
15
|
+
"locale_id": 1,
|
|
15
16
|
"slug": "root"
|
|
16
17
|
}
|
|
17
18
|
},
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
"content_type": ["tests", "eventpage"],
|
|
30
31
|
"path": "00010001",
|
|
31
32
|
"url_path": "/home/",
|
|
33
|
+
"locale_id": 1,
|
|
32
34
|
"slug": "home"
|
|
33
35
|
}
|
|
34
36
|
},
|
|
@@ -57,6 +59,7 @@
|
|
|
57
59
|
"content_type": ["tests", "eventpage"],
|
|
58
60
|
"path": "000100010001",
|
|
59
61
|
"url_path": "/home/about-us/",
|
|
62
|
+
"locale_id": 1,
|
|
60
63
|
"slug": "about-us"
|
|
61
64
|
}
|
|
62
65
|
},
|
|
@@ -85,6 +88,7 @@
|
|
|
85
88
|
"content_type": ["tests", "eventpage"],
|
|
86
89
|
"path": "00010002",
|
|
87
90
|
"url_path": "/example-home/",
|
|
91
|
+
"locale_id": 1,
|
|
88
92
|
"slug": "example-home"
|
|
89
93
|
}
|
|
90
94
|
},
|
|
@@ -113,6 +117,7 @@
|
|
|
113
117
|
"content_type": ["tests", "eventpage"],
|
|
114
118
|
"path": "000100020001",
|
|
115
119
|
"url_path": "/example-home/content/",
|
|
120
|
+
"locale_id": 1,
|
|
116
121
|
"slug": "content",
|
|
117
122
|
"owner": 1
|
|
118
123
|
}
|
|
@@ -142,6 +147,7 @@
|
|
|
142
147
|
"content_type": ["tests", "eventpage"],
|
|
143
148
|
"path": "0001000200010001",
|
|
144
149
|
"url_path": "/example-home/content/page-1/",
|
|
150
|
+
"locale_id": 1,
|
|
145
151
|
"slug": "page-1",
|
|
146
152
|
"owner": 1
|
|
147
153
|
}
|
|
@@ -171,6 +177,7 @@
|
|
|
171
177
|
"content_type": ["tests", "eventpage"],
|
|
172
178
|
"path": "0001000200010002",
|
|
173
179
|
"url_path": "/example-home/content/page-2/",
|
|
180
|
+
"locale_id": 1,
|
|
174
181
|
"slug": "page-2",
|
|
175
182
|
"owner": 1
|
|
176
183
|
}
|
|
@@ -200,6 +207,7 @@
|
|
|
200
207
|
"content_type": ["tests", "eventpage"],
|
|
201
208
|
"path": "000100020002",
|
|
202
209
|
"url_path": "/example-home/other-content/",
|
|
210
|
+
"locale_id": 1,
|
|
203
211
|
"slug": "other-content",
|
|
204
212
|
"owner": 1
|
|
205
213
|
}
|
|
@@ -229,6 +237,7 @@
|
|
|
229
237
|
"content_type": ["tests", "eventpage"],
|
|
230
238
|
"path": "00010002000100020001",
|
|
231
239
|
"url_path": "/example-home/content/page-2/child-1/",
|
|
240
|
+
"locale_id": 1,
|
|
232
241
|
"slug": "child-1",
|
|
233
242
|
"owner": 1
|
|
234
243
|
}
|
|
@@ -258,6 +267,7 @@
|
|
|
258
267
|
"content_type": ["tests", "eventpage"],
|
|
259
268
|
"path": "00010003",
|
|
260
269
|
"url_path": "/home-2/",
|
|
270
|
+
"locale_id": 1,
|
|
261
271
|
"slug": "home-2"
|
|
262
272
|
}
|
|
263
273
|
},
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"content_type": ["wagtailcore", "page"],
|
|
30
30
|
"path": "0001",
|
|
31
31
|
"url_path": "/",
|
|
32
|
+
"locale_id": 1,
|
|
32
33
|
"slug": "root"
|
|
33
34
|
}
|
|
34
35
|
},
|
|
@@ -46,6 +47,7 @@
|
|
|
46
47
|
"content_type": ["wagtailcore", "page"],
|
|
47
48
|
"path": "00010001",
|
|
48
49
|
"url_path": "/home/",
|
|
50
|
+
"locale_id": 1,
|
|
49
51
|
"slug": "home"
|
|
50
52
|
}
|
|
51
53
|
},
|
|
@@ -63,6 +65,7 @@
|
|
|
63
65
|
"content_type": ["tests", "eventindex"],
|
|
64
66
|
"path": "000100010001",
|
|
65
67
|
"url_path": "/home/events/",
|
|
68
|
+
"locale_id": 1,
|
|
66
69
|
"slug": "events"
|
|
67
70
|
}
|
|
68
71
|
},
|
|
@@ -87,6 +90,7 @@
|
|
|
87
90
|
"content_type": ["tests", "eventpage"],
|
|
88
91
|
"path": "0001000100010001",
|
|
89
92
|
"url_path": "/home/events/christmas/",
|
|
93
|
+
"locale_id": 1,
|
|
90
94
|
"slug": "christmas",
|
|
91
95
|
"owner": 1
|
|
92
96
|
}
|
|
@@ -129,6 +133,7 @@
|
|
|
129
133
|
"content_type": ["tests", "eventpage"],
|
|
130
134
|
"path": "0001000100010002",
|
|
131
135
|
"url_path": "/home/events/tentative-unpublished-event/",
|
|
136
|
+
"locale_id": 1,
|
|
132
137
|
"slug": "tentative-unpublished-event",
|
|
133
138
|
"owner": 1
|
|
134
139
|
}
|
|
@@ -159,6 +164,7 @@
|
|
|
159
164
|
"content_type": ["tests", "eventpage"],
|
|
160
165
|
"path": "0001000100010003",
|
|
161
166
|
"url_path": "/home/events/someone-elses-event/",
|
|
167
|
+
"locale_id": 1,
|
|
162
168
|
"slug": "someone-elses-event",
|
|
163
169
|
"owner": 1
|
|
164
170
|
}
|
|
@@ -189,6 +195,7 @@
|
|
|
189
195
|
"content_type": ["tests", "simplepage"],
|
|
190
196
|
"path": "000100010002",
|
|
191
197
|
"url_path": "/home/about-us/",
|
|
198
|
+
"locale_id": 1,
|
|
192
199
|
"slug": "about-us"
|
|
193
200
|
}
|
|
194
201
|
},
|
|
@@ -213,6 +220,7 @@
|
|
|
213
220
|
"content_type": ["tests", "simplepage"],
|
|
214
221
|
"path": "000100010005",
|
|
215
222
|
"url_path": "/home/other/",
|
|
223
|
+
"locale_id": 1,
|
|
216
224
|
"slug": "other"
|
|
217
225
|
}
|
|
218
226
|
},
|
|
@@ -237,6 +245,7 @@
|
|
|
237
245
|
"content_type": ["tests", "eventpage"],
|
|
238
246
|
"path": "0001000100050001",
|
|
239
247
|
"url_path": "/home/other/special-event/",
|
|
248
|
+
"locale_id": 1,
|
|
240
249
|
"slug": "special-event"
|
|
241
250
|
}
|
|
242
251
|
},
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Generated by Django 5.2.7 on 2025-11-14 04:38
|
|
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', '0058_customlocktask'),
|
|
11
|
+
('wagtailcore', '0095_groupsitepermission'),
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
operations = [
|
|
15
|
+
migrations.CreateModel(
|
|
16
|
+
name='NoPromotePage',
|
|
17
|
+
fields=[
|
|
18
|
+
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')),
|
|
19
|
+
],
|
|
20
|
+
options={
|
|
21
|
+
'abstract': False,
|
|
22
|
+
},
|
|
23
|
+
bases=('wagtailcore.page',),
|
|
24
|
+
),
|
|
25
|
+
]
|
wagtail/test/testapp/models.py
CHANGED
|
@@ -209,6 +209,10 @@ class SimplePage(Page):
|
|
|
209
209
|
return "%s (simple page)" % super().get_admin_display_title()
|
|
210
210
|
|
|
211
211
|
|
|
212
|
+
class NoPromotePage(Page):
|
|
213
|
+
promote_panels = []
|
|
214
|
+
|
|
215
|
+
|
|
212
216
|
class MultiPreviewModesPage(Page):
|
|
213
217
|
preview_templates = {
|
|
214
218
|
"original": "tests/simple_page.html",
|
|
@@ -1163,6 +1167,9 @@ register_snippet(ModelWithCustomManager)
|
|
|
1163
1167
|
class RevisableModel(RevisionMixin, models.Model):
|
|
1164
1168
|
text = models.TextField()
|
|
1165
1169
|
|
|
1170
|
+
def __str__(self):
|
|
1171
|
+
return self.text
|
|
1172
|
+
|
|
1166
1173
|
|
|
1167
1174
|
class RevisableChildModel(RevisableModel):
|
|
1168
1175
|
secret_text = models.TextField(blank=True, default="")
|
wagtail/test/testapp/views.py
CHANGED
|
@@ -334,6 +334,10 @@ class EventPageFilterSet(PageListingViewSet.filterset_class):
|
|
|
334
334
|
fields = ["audience"]
|
|
335
335
|
|
|
336
336
|
|
|
337
|
+
class EventPageIndexView(PageListingViewSet.index_view_class):
|
|
338
|
+
list_export = ["pk", "title", "audience", "event_date"]
|
|
339
|
+
|
|
340
|
+
|
|
337
341
|
class EventPageListingViewSet(PageListingViewSet):
|
|
338
342
|
model = EventPage
|
|
339
343
|
icon = "calendar"
|
|
@@ -342,6 +346,7 @@ class EventPageListingViewSet(PageListingViewSet):
|
|
|
342
346
|
columns = PageListingViewSet.columns + [
|
|
343
347
|
Column("audience", label="Audience", sort_key="audience"),
|
|
344
348
|
]
|
|
349
|
+
index_view_class = EventPageIndexView
|
|
345
350
|
filterset_class = EventPageFilterSet
|
|
346
351
|
|
|
347
352
|
|