Skip to main content

Flask-WTF-Decorators Build Status

Using decorators to validate form.

Installation

Using pip

pip install flask-wtf-decorators

Using Pipenv

pipenv install flask-wtf-decorators

Usage

Flask-WTF-Decorators is easy to use. You can define a view that requires validation.

from flask-wtf-decorators import FormValidator

form_validator = FormValidator()

@form_validator.validate_form(TestForm)
@app.route('/', methods=['GET', 'POST'])
def index(form):
    pass

You can tell Flask-WTF-Decorators what to do when a form is illegal. To do this you should provide a callback for error_handler.

@form_validator.error_handler
def error_handler(errors):
    return jsonify({'errors': errors}), 400

Test

python -m unittest discover -s tests

Contributing

Please submit a pull request to contribute.

License

This project is licensed under the MIT License.

Metadata

Release files for Flask-WTF-Decorators 0.1.2

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

Built distribution (wheel)

Table of built distributions (wheels) for Flask-WTF-Decorators 0.1.2
File Interpreter ABI Platform
Flask_WTF_Decorators-0.1.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Release files / Flask_WTF_Decorators-0.1.2-py2.py3-none-any.whl

Download URL Flask_WTF_Decorators-0.1.2-py2.py3-none-any.whl
Size 3.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
9f17b431edd6f28dcea388dc8c8e02b422a1015084d0bd716fbbef457c5be7e7
BLAKE2b-256 checksum
How to use checksums
e532238f799563d6dadce1513aed451ca613c4717c00870b813586dae92ce0f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.2 This release

1 release file

0.1.1

1 release file

0.1

2 release files

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