v0.4.0 - Back with more goodies
This release brings Wagtail 2.7 compatibility and some much needed maintenance ❤️
Changelog
- Added
construct_media_chooser_queryset
hook (#60). Thanks to @jeromelebleu - Added further template blocks (#79). Thanks to @thenewguy
- Added support for media renditions (#67). Thanks to @thenewguy
- Fixed Wagtail 2.7 compatibility (#63). Thanks to @Chris-May
New template blocks
- wagtailmedia/media/edit.html has the new
form_row
andmedia_stats
blocks - wagtailmedia/media/index.htm has the new
add_actions
block
Hooks
The addition of the construct_media_chooser_queryset
brings the wagtailmedia package one step closer to the core Wagtail documents/images behavious.
Called when rendering the media chooser view, to allow the media listing QuerySet to be customised. The callable passed into the hook will receive the current media QuerySet and the request object, and must return a Media QuerySet (either the original one, or a new one).
from wagtail.core import hooks
@hooks.register('construct_media_chooser_queryset')
def show_my_uploaded_media_only(media, request):
# Only show uploaded media
media = media.filter(uploaded_by_user=request.user)
return media