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

Support Wagtail v3 #15

Merged
merged 2 commits into from
Dec 28, 2022
Merged

Support Wagtail v3 #15

merged 2 commits into from
Dec 28, 2022

Conversation

nickmoreton
Copy link
Contributor

Upgrade package to support Wagtail 3

@nickmoreton nickmoreton changed the title initial wagtail v3 moule import changes Support Wagtail v3 Jul 19, 2022
@nickmoreton nickmoreton mentioned this pull request Jul 21, 2022
Copy link

@William-Blackie William-Blackie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @nickmoreton,

this looks great, a couple of little tweaks and this should be good to go!

Thanks - Will.

if WAGTAIL_VERSION >= (3, 0):
from wagtail.models import Site
from wagtail.admin.panels import FieldPanel
else:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @nickmoreton,

I think this a good start but it removes the functionality of wagtail <2.0. We could do something like this instead;

if WAGTAIL_VERSION >= (3, 0):
    from wagtail.models import Site
    from wagtail.admin.panels import FieldPanel
elif WAGTAIL_VERSION >= (2, 0):
    from wagtail.core.models import Site
    from wagtail.admin.edit_handlers import FieldPanel
else:
    from wagtail.wagtailcore.models import Site
    from wagtail.wagtailadmin.edit_handlers import FieldPane

else:
from wagtail.wagtailadmin.edit_handlers import InlinePanel

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same point as above.

else:
from wagtail.wagtailcore.models import Site
from wagtail.contrib.wagtailsitemaps.views import sitemap
from wagtail.contrib.sitemaps.views import sitemap

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same point as above.

@nickmoreton nickmoreton mentioned this pull request Nov 8, 2022
@unexceptable unexceptable merged commit dbe4262 into unexceptable:master Dec 28, 2022
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

Successfully merging this pull request may close these issues.

3 participants