-
Notifications
You must be signed in to change notification settings - Fork 15
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
Support Wagtail v3 #15
Conversation
There was a problem hiding this 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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same point as above.
Upgrade package to support Wagtail 3