---
local:
depth: 1
---
When using a queryset to render a list of images, you can now use the prefetch_renditions()
queryset method to prefetch the renditions needed for rendering with a single extra query, similar to prefetch_related
. If you have many renditions per image, you can also call it with filters as arguments - prefetch_renditions("fill-700x586", "min-600x400")
- to fetch only the renditions you intend on using for a smaller query. For long lists of images, this can provide a significant boost to performance. See [](prefetching_image_renditions) for more examples. This feature was developed by Tidiane Dia and Karl Hobley.
base_url_path
to ModelAdmin
so that the default URL structure of app_label/model_name can be overridden (Vu Pham, Khanh Hoang)full_url
to the API output of ImageRenditionField
(Paarth Agarwal)InlinePanel
's label when available for field comparison label (Sandil Ranasinghe)FormData
instead of jQuery's form.serialize
when editing documents or images just added so that additional fields can be better supported (Stefan Hammer)wagtail.admin.views.generic
(Matt Westcott)wagtail.admin.widgets.chooser.BaseChooser
to make it easier to build custom chooser inputs (Matt Westcott)WAGTAIL_ENABLE_UPDATE_CHECK = 'lts'
(Tibor Leupold)prefetch_renditions
method to ImageQueryset
for performance optimisation on image listings (Tidiane Dia, Karl Hobley)get_field_clean_name
method when defining FormField
models that extend AbstractFormField
(LB (Ben) Johnston)core.css
file (Thibaud Colas)ReportView
to extend from generic wagtail.admin.views.generic.models.IndexView
(Sage Abdullah)wagtail.admin.viewsets.chooser.ChooserViewSet
module to serve as a common base implementation for chooser modals (Matt Westcott)wagtail.admin.viewsets.model.ModelViewSet
(Matt Westcott)ModelAdmin
index listings with export list enabled would show buttons with an incorrect layout (Josh Woodcock)ResumeWorkflowActionFormatter
message (Stefan Hammer)PageRevision
with generic Revision
model (Sage Abdullah)base_url_path
keyword argument added to AdminURLHelperThe wagtail.contrib.modeladmin.helpers.AdminURLHelper
class now accepts a base_url_path
keyword argument on its constructor. Custom subclasses of this class should be updated to accept this keyword argument.
Safari 13 will no longer be officially supported as of this release, this deviates the current support for the last 3 version of Safari by a few months and was required to add better support for RTL languages.
PageRevision
replaced with Revision
The PageRevision
model has been replaced with a generic Revision
model. If you use the PageRevision
model in your code, make sure that:
PageRevision
objects should be updated to create Revision
objects using the page's id
as the object_id
, the default Page
model's content type as the base_content_type
, and the page's specific content type as the content_type
.PageRevision.objects
manager should be updated to use the Revision.page_revisions
manager.Revision
queries that use Page.id
should be updated to cast the Page.id
to a string before using it in the query (e.g. by using str()
or Cast("page_id", output_field=CharField())
).Page
queries that use PageRevision.page_id
should be updated to cast the Revision.object_id
to an integer before using it in the query (e.g. by using int()
or Cast("object_id", output_field=IntegerField())
).PageRevision.page
should be updated to Revision.content_object
.If you maintain a package across multiple Wagtail versions that includes a model with a ForeignKey
to the PageRevision
model, you can create a helper function to correctly resolve the model depending on the installed Wagtail version, for example:
from django.db import models
from wagtail import VERSION as WAGTAIL_VERSION
def get_revision_model():
if WAGTAIL_VERSION >= (4, 0):
return "wagtailcore.Revision"
return "wagtailcore.PageRevision"
class MyModel(models.Model):
# Before
# revision = models.ForeignKey("wagtailcore.PageRevision")
revision = models.ForeignKey(get_revision_model(), on_delete=models.CASCADE)
AdminChooser
replaced with BaseChooser
Custom choosers should no longer use wagtail.admin.widgets.chooser.AdminChooser
which has been replaced with wagtail.admin.widgets.chooser.BaseChooser
.