Skip to main content

Flask-WTF-Polyglot

Flask-WTF 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 Flask-WTF’s default Form. When using PolyglotForm, fields will be rendered with polyglot markup. For example, given the following form:

from flask_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 Flask-WTF’s default Form, the output would be:

<input checked id="foo" name="foo" type="checkbox" value="y">

In addition, this package exports WTForms-Polyglot_’s custom implementation of WTForms’ SubmitField, which renders as a <button> instead of an <input> element. For example:

from flask_wtf_polyglot import PolyglotForm, SubmitField

class MyForm(PolyglotForm):
    foo = SubmitField('Bar')

Produces this output:

<button id="foo" name="foo" type="submit" value="bar">bar</button>

Dependencies

Apart from Flask-WTF, this package relies upon WTForms-Polyglot to produce polyglot markup.

Metadata

Release files for flask-wtf-polyglot 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flask-wtf-polyglot 0.4.0
File Size Uploaded Provenance Actions
flask_wtf_polyglot-0.4.0.tar.gz 3.0 kB Without provenance Details for flask_wtf_polyglot-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flask-wtf-polyglot 0.4.0
File Interpreter ABI Platform Actions
flask_wtf_polyglot-0.4.0-py3-none-any.whl Python 3 none any Details for flask_wtf_polyglot-0.4.0-py3-none-any.whl

Total release size: 6.5 kB

Release files / flask_wtf_polyglot-0.4.0.tar.gz

Download URL flask_wtf_polyglot-0.4.0.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b200237c35a2123347e4b6bff67f0152073f1c3c759f4eda4efd3dfb290b0f20
BLAKE2b-256 checksum
How to use checksums
68d564e4984fd369b0fa0d255a743f1098810c518917b8af654875dd5c4598a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.0 CPython/3.11.2 Linux/5.4.109+

Release files / flask_wtf_polyglot-0.4.0-py3-none-any.whl

Download URL flask_wtf_polyglot-0.4.0-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3540039200b9819a2d8fb07e6ee8c1d5fe9e4abe4d60afbd0af52bcfbfb624e4
BLAKE2b-256 checksum
How to use checksums
46ae0ffbebfff2e5497335a7c42ff0d95697a23e9b482312fd1f2df06825f56c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.0 CPython/3.11.2 Linux/5.4.109+

Security for flask-wtf-polyglot 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page