Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wagtail version 3+ compatibility #17

Open
Siburg opened this issue Jun 3, 2023 · 2 comments
Open

Wagtail version 3+ compatibility #17

Siburg opened this issue Jun 3, 2023 · 2 comments

Comments

@Siburg
Copy link

Siburg commented Jun 3, 2023

The package is currently limited to wagtail version >1.4 and <3.0. All of those versions are out of support: https://github.com/wagtail/wagtail/wiki/Release-schedule.

I propose to submit a PR that will:

  • fix the panels in the MetadataPageMixin so it will continue to work with Wagtail versions 3+;
  • increase minimum requirement for Wagtail to version 2.13, because it's the minimum version that supports Django 3.2;
  • upgrade the example app to use Django 3.2 and Wagtail 4.1, because those are LTS releases;

I think we could also drop support for Python 3.6, and add support for more recent Python versions.

I propose deploying the changes as a new version 3.0, because it will have breaking changes.

@bashu
Copy link
Owner

bashu commented Jun 3, 2023

please do

@Siburg Siburg changed the title Wagtail version 3+ compatability Wagtail version 3+ compatibility Jun 3, 2023
@Siburg
Copy link
Author

Siburg commented Jun 3, 2023

On second thoughts, trying to maintain compatibility with wagtail versions before 3.0 looks too hard. The trouble is the changes to module paths (https://docs.wagtail.org/en/stable/releases/3.0.html#changes-to-module-paths) in Wagtail 3.0.

I started amending wagtailmetadata/models.py like this:

from wagtail import VERSION
if VERSION[0] >= 3:
    from wagtail.admin.panels import FieldPanel as SearchImagePanel
    from wagtail.models import Site
else:
    from wagtail.core.models import Site
    from wagtail.images.edit_handlers import ImageChooserPanel as SearchImagePanel

And then using panels = [SearchImagePanel("search_image")] in the MetadataPageMixin. That looks OK by itself to me.

However, there are many more locations where changes like that are needed. For example, in wagtailmetadata/tests/settings.py I used:

if VERSION[0] >= 3:
    wagtail_app_str = "wagtail"
else:
    wagtail_app_str = "wagtail.core"

so that I could use that wagtail_app_str in the INSTALLED_APPS and MIDDLEWARE settings.

But then I encountered the example/puput_migrations directory, and amending that for dual versions starts to become too impractical.

So I now propose to increase the minimum Wagtail version to 3.0. Users with older wagtail version will need to continue using a version 2 of this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants