module documentation

Undocumented

Interface IFieldValues Marker interface for parsed fields.
Interface IForm Marker interface for form attached to dependency injection components.
Interface IParsedJSONBody Marker interface for the dict parsed from the request body's JSON contents.
Interface IProtoForm Marker interface for ProtoForm.
Interface IValidationFailureHandler Validation failure handler callable interface.
Class CrossSiteRequestForgery Cross site request forgery detected. Request aborted.
Class FieldInjector Field injector.
Class ProtoForm Form-builder.
Class RenderableFormParam A RenderableFormParam implements IRequiredParameter and IDependencyInjector to provide a RenderableForm to your route.
Function checkCSRF Check the request for cross-site request forgery, raising an EarlyExit if it is found.
Function defaultValidationFailureHandler This is the default validation failure handler, which will be used by form handlers (i.e. any routes which use klein.Requirer to require a field) in the case of any input validation failure when no other validation failure handler is registered via ...
Function textConverter Converter for form values (which may be any type of string) into text.
Constant CSRF_PROTECTION Undocumented
def checkCSRF(request): (source)

Check the request for cross-site request forgery, raising an EarlyExit if it is found.

Parameters
request:IRequestUndocumented
@bindable
def defaultValidationFailureHandler(instance, request, fieldValues): (source)

This is the default validation failure handler, which will be used by form handlers (i.e. any routes which use klein.Requirer to require a field) in the case of any input validation failure when no other validation failure handler is registered via Form.onValidationFailureFor.

Its behavior is to simply return an HTML rendering of the form object, which includes inline information about fields which failed to validate.

Parameters
instance:Optional[object]The instance associated with the router that the form handler was handled on.
request:IRequestThe request including the form submission.
fieldValues:FieldValuesUndocumented
Returns
ElementAny object acceptable from a Klein route.
def textConverter(value): (source)

Converter for form values (which may be any type of string) into text.

Parameters
value:AnyStrUndocumented
Returns
strUndocumented
CSRF_PROTECTION: str = (source)

Undocumented

Value
'__csrf_protection__'