Skip to content

v0.8.0 - You Give Me.. Choosers!

Compare
Choose a tag to compare
@zerolab zerolab released this 11 Sep 10:41
· 165 commits to main since this release

This relase brings a ton of improvements.

To start with, wagtailmedia is now 100% compatible with Wagtail 2.13+ when used in StreamFields. The media chooser now uses the correct media upload forms and should pick up any customisations you make.

Settings

We moved to a single WAGTAILMEDIA setting dictionary and introduced allowed lists for the audio and video extension. Support for the old WAGTAILMEDIA_MEDIA_MODEL and WAGTAILMEDIA_MEDIA_FORM_BASE settings will be removed in the release after next (v0.10.0)

# settings.py

WAGTAILMEDIA = {
    "MEDIA_MODEL": "",  # string, dotted-notation. Defaults to "wagtailmedia.Media"
    "MEDIA_FORM_BASE": "",   # strind, dotted-notation. Defaults to an empty string
    "AUDIO_EXTENSIONS": [],  # list of extensions
    "VIDEO_EXTENSIONS": [],  # list of extensions
}

New chooser types

  • MediaChooserPanel accepts the media_type keyword argument (kwarg) to limit the types of media that can be chosen or uploaded. At the moment only "audio" (MediaChooserPanel(media_type="audio")) and "video" (MediaChooserPanel(media_type="audio")) are supported, and any other type will make the chooser behave as if it did not get any kwarg.
  • AudioChooserBlock and VideoChooserBlock can be used in StreamField
# ...
from wagtailmedia.blocks import AudioChooserBlock, VideoChooserBlock


class BlogPage(Page):
    # ...

    body = StreamField([
        # ... other block definitions
        ('audio', AudioChooserBlock(icon='media')),
        ('video', VideoChooserBlock(icon='media')),
    ])

Changelog

  • Updated test targets to include Wagtail 2.14
  • Changed the chooser uploader forms to use correctly instantiated forms (#135)
  • Fixed the media chooser block compatibility with Wagtail 2.13 (#136. Thanks @efes)
  • Added tag-based filters (#132. Thanks @th3hamm0r)
  • Added default_auto_field for Django 3.2+ (#134. Thanks @hyperstown)
  • Refactored project structure and updated tooling (#137)
  • Added specialized StreamField blocks and support media type filter in MediaChooserPanel (#139)
  • Added file extension validation (#140)
  • Switched to a unified WAGTAILMEDIA setting dictionary (#140)