-
Notifications
You must be signed in to change notification settings - Fork 6
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
Move the custom html from the form template to a widget #745
Conversation
Check for example the customization we have to make the view compatible with Quaive: https://github.com/euphorie/osha.oira/blob/7d4f094a4ee1717f0dceee0acbfdaa4244afea4b/src/osha/oira/ploneintranet/z3cform/templates/survey_source_selection.pt |
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.
Seems to work, and is in line with your earlier PRs from this week.
One small inline suggestion, but I am not sure it is needed. I added a breakpoint there, but it did not get triggered in my test.
@adapter(Interface) | ||
class SurveySourceSelectionAdaptedContext: | ||
def __init__(self, context): | ||
pass |
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.
I suppose it would be useful to save the context so it remains available:
pass | |
self.context = context |
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.
The code before was not storing this kind of information as well.
I agree, it might be interesting to store it.
But, in that case, the most natural thing becomes moving the fields either to a behavior or to the existing content type schema.
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.
Just in case, if you feel this should be added feel free to add open an issue.
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.
This is the point where I added the breakpoint and nothing happened. So the __init__
does not seem to get called. Maybe I tried on the wrong url.
Where did you put the breakpoint? |
The reason is that we want to be able to customize that form without rewriting the whole template.