Skip to main content

WTForms extensions for Tornado.

Project description

WTForms extensions for Tornado.

WTForms-Tornado targets Python 3.11+.

Latest PyPI version

Usage

import tornado.ioloop
import tornado.web

from wtforms import IntegerField
from wtforms.validators import DataRequired
from wtforms_tornado import Form

class SumForm(Form):

    a = IntegerField(validators=[DataRequired()])
    b = IntegerField(validators=[DataRequired()])

class SumHandler(tornado.web.RequestHandler):
    def get(self):
        self.write('Hello, world')

    def post(self):
        form = SumForm(self.request.arguments)
        if form.validate():
            self.write(str(form.data['a'] + form.data['b']))
        else:
            self.set_status(400)
            self.write(str(form.errors))

application = tornado.web.Application([
    (r"/", SumHandler),
])

if __name__ == "__main__":
    application.listen(8888)
    tornado.ioloop.IOLoop.current().start()

Installation

Install the package with pip:

pip install wtforms-tornado

Or from a local checkout:

pip install .

For development work, install the dev extras:

pip install -e '.[dev]'

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

wtforms_tornado-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wtforms_tornado-0.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file wtforms_tornado-0.1.0.tar.gz.

File metadata

  • Download URL: wtforms_tornado-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wtforms_tornado-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0f9a39ee917218af0e82228505bc3ea8beda8c6e319b45ce707cd44c362c5965
MD5 e4b55c0085fe903436e358112b7602b8
BLAKE2b-256 441b28ee08dce784b4031bd65f1e6028656bbf1721d0888195f018cef021b8a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for wtforms_tornado-0.1.0.tar.gz:

Publisher: publish.yml on puentesarrin/wtforms-tornado

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wtforms_tornado-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for wtforms_tornado-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eccdfe27563550fa2578706be994833be83eb126e88c85d66d36fd66386fc97f
MD5 09c64a20907c0b288501df4f97ee30bf
BLAKE2b-256 6b6e4fcc50bcb5c9849701b9c515152358801d3a07954f1a4051b0c44f87ad92

See more details on using hashes here.

Provenance

The following attestation bundles were made for wtforms_tornado-0.1.0-py3-none-any.whl:

Publisher: publish.yml on puentesarrin/wtforms-tornado

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page