neon-jungle / wagtail-schema.org

Schema.org JSON-LD tags for Wagtail sites
BSD 2-Clause "Simplified" License
70 stars 17 forks source link

Update for Wagtail 4.0 Compatibility (BaseSiteSetting replacing BaseSetting) #13

Closed dkirkham closed 2 years ago

dkirkham commented 2 years ago

Wagtail 4.0 will start deprecating wagtail.contrib.settings.models.BaseSetting in favour of wagtail.contrib.settings.models.BaseSiteSetting or wagtail.contrib.settings.models.BaseGenericSetting. The to be deprecated class is used by wagtail-schema.org's BaseLDSetting at https://github.com/neon-jungle/wagtail-schema.org/blob/master/wagtailschemaorg/models.py#L22

Testing with Wagtail 4.0rc2 results in the following message:

.../site-packages/django/db/models/base.py:515: RemovedInWagtail50Warning: `wagtail.contrib.settings.models.BaseSetting` is obsolete and should be replaced by `wagtail.contrib.settings.models.BaseSiteSetting` or `wagtail.contrib.settings.models.BaseGenericSetting`

Release notes are at https://docs.wagtail.org/en/latest/releases/4.0.html#basesetting-model-replaced-by-basesitesetting

The solution might be to import into wagtailschemaorg/models.py BaseSiteSetting, and if that fails, fall back to BaseSetting.

nickmoreton commented 2 years ago

This change is included in: https://github.com/neon-jungle/wagtail-schema.org/pull/15

dkirkham commented 2 years ago

Thanks @nickmoreton, any idea when #15 will be merged and the package released to PyPi?

nickmoreton commented 2 years ago

Thanks @nickmoreton, any idea when #15 will be merged and the package released to PyPi?

Sorry no but I'm sure it will be soon 👍

dkirkham commented 2 years ago

Thanks all.