Skip to main content

Data validator for Flask using SQL-Alchemy, working at Model component with events

Project description

Travis Code Climate Documentation Status PyPI version Coverage Status


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

  • ValidateRegex

  • ValidateIP

  • ValidateURL

  • Location

  • ValidateCountry

  • ValidateTimezone

  • ValidateLocale

  • Others

  • ValidateUUID

Project details


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.7.tar.gz (4.5 kB view details)

Uploaded Source

File details

Details for the file Flask-Validator-0.7.tar.gz.

File metadata

  • Download URL: Flask-Validator-0.7.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Flask-Validator-0.7.tar.gz
Algorithm Hash digest
SHA256 9a4bb380b44230565737255a83c760dbc8ab12ba299759eb7ee867bb7e31467e
MD5 81cb0c38e48d7e039dfc32f17f3d891c
BLAKE2b-256 949dc155d241e1ec182ecc858efec82bc5308e7a96dfd0c5453e6423434dc3f6

See more details on using hashes here.

Supported by

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