-
Notifications
You must be signed in to change notification settings - Fork 58
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
Fix circular import for PageInterface
when using custom page interface
#404
Fix circular import for PageInterface
when using custom page interface
#404
Conversation
CI is failing for the coverage job, but it looks like all recent CI runs are failing on that. |
Since we're making these changes, it may be worth moving the |
Ah, I had meant to do that, but got carried away. Thanks! |
# This conditionnal and below support both Wagtail >= 2.13 and <2.12 versions. | ||
# The "stream_data" check can be dropped once 2.11 is not supported anymore. | ||
# Cf: https://docs.wagtail.io/en/stable/releases/2.12.html#stream-data-on-streamfield-values-is-deprecated | ||
elif hasattr(obj, "stream_data"): |
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.
note to self: follow up with clean-up PR
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.
LGTM
I'd like to define a custom
PageInterface
(using thePAGE_INTERFACE
setting). Becausegrapple.types.pages.PageInterface
is quite complex, I'd like to inherit from it, and add some additional fields.This results in a circular import, because the definition of the
Page
class in the same module callsget_page_interface
:wagtail-grapple/grapple/types/pages.py
Lines 165 to 173 in d9cd8f2
This PR moves
PageInterface
andget_page_interface
to a new module,interfaces.py
.