Data validator for Flask using SQL-Alchemy, working at Model component with events
Project description
Description
Data validator for Flask using SQL-Alchemy, working at Model component with events, preventing invalid data in the columns.
Instalation
pip install flask-validator
Documentation
For the online documentation, follow this link
Basic usage
from flask_validator import ValidateInteger, ValidateString
class User(db.Model):
__tablename__ = 'user'
id = db.Column(db.Integer, primary_key=True)
string = db.Column(db.String(80))
integer = db.Column(db.Integer())
def __init__(self, string, integer):
self.string = string
self.integer = integer
@classmethod
def __declare_last__(cls):
ValidateInteger(User.integer)
ValidateString(User.string)
Available Constraints
ValidateInteger
ValidateNumeric
ValidateString
ValidateBoolean
ValidateLenght
ValidateLessThan
ValidateLessThanOrEqual
ValidateGreaterThan
ValidateGreaterThanOrEqual
ValidateEmail
ValidateRegex
ValidateIP
ValidateURL
ValidateUUID
ValidateCountry
ValidateTimezone
ValidateLocale
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Flask-Validator-0.6.tar.gz
(4.3 kB
view details)
File details
Details for the file Flask-Validator-0.6.tar.gz.
File metadata
- Download URL: Flask-Validator-0.6.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99cf1b9b059e4c66d7ae2dc79ad0b1bd97bfedb00d139081949c72354ab13cc5
|
|
| MD5 |
0eb7c3bb8a0bf54945bbd06c92a80470
|
|
| BLAKE2b-256 |
22436376d5a24e7f12d0e13e301b0d633e286f63cae5fc6b48854718548710ac
|