kopia lustrzana https://github.com/wagtail/wagtail
Add upgrade consideration note for change to BaseSetting
rodzic
29d564c238
commit
61ed6caa57
|
@ -1,8 +1,7 @@
|
|||
# Settings
|
||||
|
||||
The `wagtail.contrib.settings` module allows you to define models that hold
|
||||
settings which are either generic (that is the same) across all `Site`s or
|
||||
specific to each `Site`.
|
||||
settings which are either common across all site records, or specific to each site.
|
||||
|
||||
Settings are editable by administrators within the Wagtail admin, and can be
|
||||
accessed in code as well as in templates.
|
||||
|
|
|
@ -364,3 +364,25 @@ As part of the page editor redesign, we have removed support for the `classname=
|
|||
- This is an optional replacement, there are no immediate plans to remove the `route` decorator at this time.
|
||||
- The `RoutablePageMixin` contrib module now provides a `path` decorator that behaves the same way as Django's [`django.urls.path`](https://docs.djangoproject.com/en/stable/ref/urls/#django.urls.path) function.
|
||||
- `RoutablePageMixin`'s `route` decorator will now redirect to a new `re_path` decorator that emulates the behaviour of [`django.urls.re_path`](https://docs.djangoproject.com/en/stable/ref/urls/#django.urls.re_path).
|
||||
|
||||
### `BaseSetting` model replaced by `BaseSiteSetting`
|
||||
|
||||
The `wagtail.contrib.settings.models.BaseSetting` model has been replaced by two new base models `BaseSiteSetting` and `BaseGenericSetting`, to accommodate settings that are shared across all sites. Existing setting models that inherit `BaseSetting` should be updated to use `BaseSiteSetting` instead:
|
||||
|
||||
```python
|
||||
from wagtail.contrib.settings.models import BaseSetting, register_setting
|
||||
|
||||
@register_setting
|
||||
class SiteSpecificSocialMediaSettings(BaseSetting):
|
||||
facebook = models.URLField()
|
||||
```
|
||||
|
||||
should become
|
||||
|
||||
```python
|
||||
from wagtail.contrib.settings.models import BaseSiteSetting, register_setting
|
||||
|
||||
@register_setting
|
||||
class SiteSpecificSocialMediaSettings(BaseSiteSetting):
|
||||
facebook = models.URLField()
|
||||
```
|
||||
|
|
Ładowanie…
Reference in New Issue