WTForms companion library providing `PolyglotForm` for polyglot HTML output
Project description
WTForms companion library providing PolyglotForm for polyglot HTML output.
Polyglot markup is a set of rules for how to write HTML. A document that uses polyglot markup is both a valid HTML5 document as well as a well-formed XML document, that can be served with either a text/html or an application/xhtml+xml MIME type.
This package provides the PolyglotForm class, which is built on top of WTForms’ default Form. When using PolyglotForm, fields will be rendered with polyglot markup. For example, given the following form:
from wtf_polyglot import PolyglotForm from wtforms import BooleanField class MyForm(PolyglotForm): foo = BooleanField('foo', default=True)
Rendering MyForm.foo will result in the following XML-compliant output:
<input checked="checked" id="foo" name="foo" type="checkbox" value="y" />
In contrast, using WTForms’ default Form, the output would be:
<input checked id="foo" name="foo" type="checkbox" value="y">
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for WTForms_Polyglot-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e414862461d7393c857ec33398384686fb6b568a0b5b6006b358adfb109ebae0 |
|
MD5 | 2eefdc0f2ccef87cc11e4a4c9e3bdeda |
|
BLAKE2b-256 | 543b4e68461b3015a0aa223e4d6db56a20e92d6ebbbe72454bae17844488f8cd |