Wagtailmenus 2.11 release notes¶
ModelAdmin classes used by wagtailmenus with your own¶
Previously, the only way to override any of the admin functionality within wagtailmenus was to resort to monkey-patching, which is obviously not ideal.
I wanted to provide a documented, officially supported way to do this, by allowing the default
wagtail.contrib.modelamin.ModelAdmin classes in wagtailmenus to be swapped out for custom ones with settings.
For more information see the new entries in the settings reference docs:
Minor changes & bug fixes¶
Added support for Wagtail version 2.1.
Added new ‘Wagtail’ trove classifiers in
setup.pyto reflect Wagtail version support.
runtests.pyto pass on any unparsed option arguments to Django’s test method.
runtests.pyto filter out deprecation warnings originating from other apps by default.
MenuItem.relative_url()to accept a
requestparameter (for parity with
wagtail.core.models.Page.relative_url()), so that it can pass it on to the page method.
Menu.prime_menu_items()to send the current
Moved most ‘App settings related’ tests to wagtailmenus.conf.tests, so that they’re all in one place.
Updated admin views to utilise
wagtail.admin.messages.validation_error()for reporting field-specific and non-field errors (Wagtail 2.1 has this built-in, but Wagtail 2.0 does not).
Replaced the custom app settings module with a
django-cogwheelssettings helper and removed a lot of the tests that existed to test its workings.
Moved remaining app settings tests to
If you’re using custom
MenuItemmodels in your project, and are overriding
relative_url(), you should update the method signature on your custom model to accept a
requestkeyword argument, and it on to
super().relative_url()(in addition to
site) if calling either of those. This will be mandatory in wagtailmenus 1.13.
Dropped support for Wagtail versions 1.10 to 1.13.
Dropped support for Django versions 1.8 to 1.10.
Menu.prime_menu_items() now returns a list instead of a generator. This is required to allow the method to raise warnings.
modeladminclasses have moved from
wagtailmenus.wagtail_hooksto a new
MainMenuAdminfrom the wagtail_hooks will still continue to work, but any references to
wagtailmenus.wagtail_hooks.FlatMenuButtonHelperwill need to be updated.
If for any reason you are importing view classes directly from
wagtailmenus.wagtail_hooks, that will no longer work. You will have to update your code to import view classes from the views module itself (