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
File details
Details for the file marbaloo_validators-0.1.1.tar.gz.
File metadata
- Download URL: marbaloo_validators-0.1.1.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f995c881785f2c07e87ebb8f1eb5d88e8fc9f6124cfaae534371e331cebe6f67
|
|
| MD5 |
a32a43c56f6c70c71f2f0a2a7d59dd6f
|
|
| BLAKE2b-256 |
6570540cb3c73e44492f5412b9cc5bfee992da9a9f0936d0eff2f71d853993f8
|