Wagtail 1.7 release notes¶
What’s new¶
Elasticsearch 2 support¶
Wagtail now supports Elasticsearch 2. Note that you need to change backend in WAGTAILSEARCH_BACKENDS, if you wish to switch to Elasticsearch 2. This feature was developed by Karl Hobley.
See: Elasticsearch 平台
New image tag options for file type and JPEG compression level¶
The {% image %} tag now supports extra parameters for specifying the image file type and JPEG compression level on a per-tag basis. See 输出图片格式 and jpeg_image_quality. This feature was developed by Karl Hobley.
AWS CloudFront support added to cache invalidation module¶
Wagtail’s cache invalidation module can now invalidate pages cached in AWS CloudFront when they are updated or unpublished. This feature was developed by Rob Moorman.
See: Amazon CloudFront
Unpublishing subpages¶
Unpublishing a page now gives the option to unpublish its subpages at the same time. This feature was developed by Jordi Joan.
Minor features¶
The
|embedfilter has been converted into a templatetag{% embed %}(Janneke Janssen)The
wagtailformsmodule now provides aFormSubmissionPanelfor displaying details of form submissions; see Displaying form submission information for documentation. (João Luiz Lorencetti)The Wagtail version number can now be obtained as a tuple using
from wagtail import VERSION(Tim Heap)
send_maillogic has been moved fromAbstractEmailForm.process_form_submissionintoAbstractEmailForm.send_mail. Now it’s easier to override this logic (Tim Leguijt)Added
before_create_page,before_edit_page,before_delete_pagehooks (Karl Hobley)Updated font sizes and colours to improve legibility of admin menu and buttons (Stein Strindhaug)
Added pagination to “choose destination” view when moving pages (Nick Smith, Žan Anderle)
Added ability to annotate search results with score - see 使用分数标注查询结果 (Karl Hobley)
Added ability to limit access to form submissions - see filter_form_submissions_for_user (Mikalai Radchuk)
Added the ability to configure the number of days search logs are kept for, through the WAGTAILSEARCH_HITS_MAX_AGE setting (Stephen Rice)
SnippetChooserBlocknow supports passing the model name as a string (Nick Smith)Redesigned account settings / logout area in the sidebar for better clarity (Janneke Janssen)
Pillow’s image optimisation is now applied when saving JPEG images (Karl Hobley)
Bug fixes¶
Migrations for wagtailcore and project template are now reversible (Benjamin Bach)
Migrations no longer depend on wagtailcore and taggit’s
__latest__migration, logically preventing those apps from receiving new migrations (Matt Westcott)The default image format label text (‘Full width’, ‘Left-aligned’, ‘Right-aligned’) is now localised (Mikalai Radchuk)
Text on the front-end ‘password required’ form is now marked for translation (Janneke Janssen)
Text on the page view restriction form is now marked for translation (Luiz Boaretto)
Fixed toggle behaviour of userbar on mobile (Robert Rollins)
Image rendition / document file deletion now happens on a post_delete signal, so that files are not lost if the deletion does not proceed (Janneke Janssen)
“Your recent edits” list on dashboard no longer leaves out pages that another user has subsequently edited (Michael Cordover, Kees Hink, João Luiz Lorencetti)
InlinePanelnow accepts aclassnameparameter as per the documentation (emg36, Matt Westcott)Disabled use of escape key to revert content of rich text fields, which could cause accidental data loss (Matt Westcott)
Setting
USE_THOUSAND_SEPARATOR = Trueno longer breaks the rendering of numbers in JS code for InlinePanel (Mattias Loverot, Matt Westcott)Images / documents pagination now preserves GET parameters (Bojan Mihelac)
Wagtail’s UserProfile model now sets a related_name of
wagtail_userprofileto avoid naming collisions with other user profile models (Matt Westcott)Non-text content is now preserved when adding or editing a link within rich text (Matt Westcott)
Fixed preview when
SECURE_SSL_REDIRECT = True(Aymeric Augustin)Prevent hang when truncating an image filename without an extension (Ricky Robinett)
Upgrade considerations¶
Project template’s initial migration should not depend on wagtailcore.__latest__¶
On projects created under previous releases of Wagtail, the home/migrations/0001_initial.py migration created by the wagtail start command contains the following dependency line:
dependencies = [
('wagtailcore', '__latest__'),
]
This may produce InconsistentMigrationHistory errors under Django 1.10 when upgrading Wagtail, since Django interprets this to mean that no new migrations can legally be added to wagtailcore after this migration is applied. This line should be changed to:
dependencies = [
('wagtailcore', '0029_unicode_slugfield_dj19'),
]
Custom image models require a data migration for the new filter_spec field¶
The data model for image renditions will be changed in Wagtail 1.8 to eliminate Filter as a model. Wagtail sites using a custom image model (see Custom image models) need to have a schema and data migration in place prior to upgrading to Wagtail 1.8. To create these migrations:
Run
manage.py makemigrationsto create the schema migrationRun
manage.py makemigrations --empty myapp(replacingmyappwith the name of the app containing the custom image model) to create an empty migrationEdit the created migration to contain:
from wagtail.wagtailimages.utils import get_fill_filter_spec_migrationsand, for the
operationslist:forward, reverse = get_fill_filter_spec_migrations('myapp', 'CustomRendition') operations = [ migrations.RunPython(forward, reverse), ]replacing
myappandCustomRenditionwith the app and model name for the custom rendition model.
embed template filter is now a template tag¶
The embed template filter, used to translate the URL of a media resource (such as a YouTube video) into a corresponding embeddable HTML fragment, has now been converted to a template tag. Any template code such as:
{% load wagtailembeds_tags %}
...
{{ my_media_url|embed }}
should now be rewritten as:
{% load wagtailembeds_tags %}
...
{% embed my_media_url %}