kopia lustrzana https://github.com/wagtail/wagtail
Reshuffle 5.2 upgrade consideration notes
* It's unclear why the imghdr change affects developers, or what action if any they should take - I don't think this needs a note at all * Changes to menu hooks really come under the category of "Wagtail customisations", not "Changes affecting all projects"pull/11170/head
rodzic
f0180f95e3
commit
3002ac070d
|
@ -202,52 +202,6 @@ As part of our [adoption of Stimulus](https://github.com/wagtail/rfcs/blob/main/
|
|||
* Add better deprecation warnings to the `search.Query` & `search.QueryDailyHits` model, move final set of templates from the admin search module to the search promotions contrib module (LB (Ben) Johnston)
|
||||
|
||||
|
||||
## Upgrade considerations - changes affecting all projects
|
||||
|
||||
### Removal of `imghdr` and upgrade to `Willow`
|
||||
|
||||
[`imghdr`](https://docs.python.org/3/library/imghdr.html) is deprecated, and will be removed in Python 3.13.
|
||||
|
||||
Wagtail now uses the Willow feature of providing the image MIME type, which uses the [`filetype`](https://pypi.org/project/filetype/) package.
|
||||
|
||||
### Adoption of `classname` convention for `MenuItem` related classes and hooks
|
||||
|
||||
Wagtail `MenuItem` and menu hooks have been updated to use the more consistent naming of `classname` (singular) instead of `classnames` (plural), a convention that started in Wagtail 4.2.
|
||||
|
||||
The current `classnames` keyword argument naming will be supported, but will trigger a deprecation warning. Support for this variant will be removed in a future release.
|
||||
|
||||
The following classes will adopt this new convention.
|
||||
|
||||
- `admin.menu.MenuItem`
|
||||
- `admin.ui.sidebar.ActionMenuItem`
|
||||
- `admin.ui.sidebar.LinkMenuItem`
|
||||
- `admin.ui.sidebar.PageExplorerMenuItem`
|
||||
- `contrib.settings.registry.SettingMenuItem`
|
||||
|
||||
The following hooks usage may be impacted if `classnames` were used when generating menu items.
|
||||
|
||||
- `register_admin_menu_item`
|
||||
- `register_settings_menu_item`
|
||||
|
||||
### Example
|
||||
|
||||
```python
|
||||
from django.urls import reverse
|
||||
|
||||
from wagtail import hooks
|
||||
from wagtail.admin.menu import MenuItem
|
||||
|
||||
@hooks.register('register_admin_menu_item')
|
||||
def register_frank_menu_item():
|
||||
return MenuItem(
|
||||
'Frank',
|
||||
reverse('frank'),
|
||||
icon_name='folder-inverse',
|
||||
order=10000,
|
||||
classname="highlight-menu" # not classnames=...
|
||||
)
|
||||
```
|
||||
|
||||
## Upgrade considerations - deprecation of old functionality
|
||||
|
||||
### Legacy moderation system is deprecated
|
||||
|
@ -277,6 +231,44 @@ If you use any of the above features, remove them or replace them with the equiv
|
|||
|
||||
## Upgrade considerations - changes affecting Wagtail customisations
|
||||
|
||||
### Adoption of `classname` convention for `MenuItem` related classes and hooks
|
||||
|
||||
Wagtail `MenuItem` and menu hooks have been updated to use the more consistent naming of `classname` (singular) instead of `classnames` (plural), a convention that started in Wagtail 4.2.
|
||||
|
||||
The current `classnames` keyword argument naming will be supported, but will trigger a deprecation warning. Support for this variant will be removed in a future release.
|
||||
|
||||
The following classes will adopt this new convention.
|
||||
|
||||
- `admin.menu.MenuItem`
|
||||
- `admin.ui.sidebar.ActionMenuItem`
|
||||
- `admin.ui.sidebar.LinkMenuItem`
|
||||
- `admin.ui.sidebar.PageExplorerMenuItem`
|
||||
- `contrib.settings.registry.SettingMenuItem`
|
||||
|
||||
The following hooks usage may be impacted if `classnames` were used when generating menu items.
|
||||
|
||||
- `register_admin_menu_item`
|
||||
- `register_settings_menu_item`
|
||||
|
||||
#### Example
|
||||
|
||||
```python
|
||||
from django.urls import reverse
|
||||
|
||||
from wagtail import hooks
|
||||
from wagtail.admin.menu import MenuItem
|
||||
|
||||
@hooks.register('register_admin_menu_item')
|
||||
def register_frank_menu_item():
|
||||
return MenuItem(
|
||||
'Frank',
|
||||
reverse('frank'),
|
||||
icon_name='folder-inverse',
|
||||
order=10000,
|
||||
classname="highlight-menu" # not classnames=...
|
||||
)
|
||||
```
|
||||
|
||||
### Edit and delete URLs in `ModelViewSet` changed to allow non-integer primary keys
|
||||
|
||||
To accommodate models with non-integer primary keys, the URL patterns for the edit and delete views in {class}`~wagtail.admin.viewsets.model.ModelViewSet` have been changed.
|
||||
|
|
Ładowanie…
Reference in New Issue