class Field: (source)
Known subclasses: klein.test.test_form.DanglingField
Implements interfaces: klein.interfaces.IRequiredParameter
Class Method | hidden |
Shorthand for a hidden field. |
Class Method | number |
An integer within the range [minimum, maximum]. |
Class Method | password |
Shorthand for a form field that, like text , contains a short string, but should be obscured when typed (and, to the extent possible, obscured in other sensitive contexts, such as logging.) |
Class Method | submit |
A field representing a submit button, with a value (displayed on the button). |
Class Method | text |
Shorthand for a form field that contains a short string, and will be rendered as a plain <input>. |
Method | as |
Convert this Field into some stuff that can be rendered in a twisted.web.template . |
Method | extract |
Extract a value from the request. |
Method | maybe |
Create a new Field like this one, but with all the name default values filled in. |
Method | register |
Register this form field as a dependency injector. |
Method | validate |
Validate the given text and return a converted Python object to use, or fail with ValidationError . |
Instance Variable | converter |
The converter. |
Instance Variable | default |
Undocumented |
Instance Variable | error |
Undocumented |
Instance Variable | form |
Undocumented |
Instance Variable | form |
Undocumented |
Instance Variable | form |
Undocumented |
Instance Variable | no |
Undocumented |
Instance Variable | python |
Undocumented |
Instance Variable | required |
Undocumented |
Instance Variable | value |
Undocumented |
Shorthand for a form field that contains a short string, and will be rendered as a plain <input>.
Parameters | |
**kw:Any | Undocumented |
Returns | |
Field | Undocumented |
Convert this Field
into some stuff that can be rendered in a twisted.web.template
.
Returns | |
Iterable[ | A new set of tags to include in a template. |
Extract a value from the request.
In the case of key/value form posts, this attempts to reliably make the value into str. In the case of a JSON post, however, it will simply extract the value from the top-level dictionary, which means it could be any arrangement of JSON-serializiable objects.
Parameters | |
request:IRequest | Undocumented |
Returns | |
Any | Undocumented |
Register this form field as a dependency injector.
Parameters | |
injectionComponentized | Undocumented |
parameterstr | Undocumented |
requestIRequestLifecycle | Undocumented |
Returns | |
IDependencyInjector | Undocumented |
Validate the given text and return a converted Python object to use, or fail with ValidationError
.
Parameters | |
value:Any | The value that was extracted by Field.extractValue . |
Returns | |
Any | The converted value. |