Skip to main content

validators library support for cherrypy.

Installation

pip install marbaloo_validators

Usage

# app.py
import cherrypy
import marbaloo_validators
import os

marbaloo_validators.Plugin(cherrypy.engine).subscribe()
cherrypy.tools.validators = marbaloo_validators.Tool()


class Root(object):

    @cherrypy.expose
    def index(self):
        validators = cherrypy.request.validators
        if validators.email('example@site.com'):
            return 'TRUE'
        else:
            return 'FALSE'

root_path = os.path.dirname(__file__)
config = {
    '/': {
        'tools.validators.on': True
    }
}
cherrypy.quickstart(Root(), '/', config)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

marbaloo_validators-0.1.1.tar.gz (2.2 kB view details)

Uploaded Source

File details

Details for the file marbaloo_validators-0.1.1.tar.gz.

File metadata

File hashes

Hashes for marbaloo_validators-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f995c881785f2c07e87ebb8f1eb5d88e8fc9f6124cfaae534371e331cebe6f67
MD5 a32a43c56f6c70c71f2f0a2a7d59dd6f
BLAKE2b-256 6570540cb3c73e44492f5412b9cc5bfee992da9a9f0936d0eff2f71d853993f8

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 file

Supported by

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