def actions__submit__post_handler(form, **_): if form.is_valid(): return html.pre(f"You posted: {form.apply(Struct())}" ).bind(request=request)
def page_view_example_3(request): math_result = 1 + 1 return HelloWorldPage(parts__result=html.pre( format_html("Math result: 1+1={}", math_result)), )
def on_submit(form, **_): if not form.is_valid(): return return html.pre(f"You posted: {form.apply(Struct())}").bind( request=request)
class MathPage(HelloWorldPage): result = html.pre(format_html("Math result: 1+1={}", math_result))