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
Types
ValidateInteger
ValidateNumeric
ValidateString
ValidateBoolean
Numeric
ValidateLenght
Comparision
ValidateLessThan
ValidateLessThanOrEqual
ValidateGreaterThan
ValidateGreaterThanOrEqual
Internet
ValidateEmail
ValidateIP
ValidateURL
Location
ValidateCountry
ValidateTimezone
ValidateLocale
Finantial
ValidateCreditCard
ValidateCurrency
ValidateIBAN
Others
ValidateUUID
ValidateISBN
ValidateRegex
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.9.1.tar.gz
(9.9 kB
view hashes)