Skip to main content

Validators library support for cherrypy.

Project description

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)

Project details


Release history Release notifications

Download files

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

Files for marbaloo_validators, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size marbaloo_validators-0.1.1.tar.gz (2.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page