How to use the klein.Form.rendererFor function in klein

To help you get started, we’ve selected a few klein examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github twisted / klein / loginspike.py View on Github external
                  login_form=Form.rendererFor(dologin, action="/login")
)
def loginform(login_form):
    # type: (RenderableForm) -> Dict
    return {
        "loginActive": "active",
        "glue_here": login_form.glue()
    }
github twisted / klein / loginspike.py View on Github external
                  theForm=Form.rendererFor(doSignup, action="/signup")
)
def signupPage(theForm):
    # type: (RenderableForm) -> Dict
    return {
        "glue_here": theForm.glue(),
        "signupActive": "active"
    }
github twisted / klein / loginspike.py View on Github external
    style.renderMethod, form=Form.rendererFor(bye, "/logout")
)
def logoutGlue(tag, form):
    # type: (Tag, RenderableForm) -> Tag
    return tag(form.glue())
github twisted / klein / docs / introduction / codeexamples / forms.py View on Github external
    renderer=Form.rendererFor(postHandler, action=u"/?post=yes"),
)
def validationFailed(values, renderer):
    renderer.prevalidationValues = values.prevalidationValues
    renderer.validationErrors = values.validationErrors
    return {'the-invalid-form': renderer}