Python3 Validation in another way
Project description
SmileValidation
Python3 Validation in another way
I hurt enough for validating those form's elements. Time to bring a new reference type.
It's gonna solve like this way:
from Validator import Validator
from Rule import Rule
Rule
It is the collection of what we wanna validate to those element objects
Example:
Add this to Rule.py as piece of an element validation.
# field
self.__emailOne = self.__type.getString(
require= True
, maxLength= 75
, minLength= 8
, unicode= False
, regex= None
)
Create a test.py for testing reason.\
from Validator import Validator
from Rule import Rule
# instance
rule = Rule()
validator = Validator()
# emailOne is an element of html form
validator.addElement(
elementName ='emailOne'
, elementValue= 'masako'
, rule= rule.getEmailOne()
)
if validator.isValid():
print(f'Valid')
else:
print(f'Invalid')
# get error with showing the happening of the element
print(f'{validator.getError()}')
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
SmileValidation-1.0.0.tar.gz
(2.0 kB
view hashes)
Built Distribution
Close
Hashes for SmileValidation-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cc590641e0d4ea8cd92559bdd73239adac754eb32001b9efea87a1a23c1d82f |
|
MD5 | 972f9fd985b83b13a679dff727927b2a |
|
BLAKE2b-256 | e5c0be5b350ea02caafedaaedc8cd21845fa8c78db2f51e38e7a645674d2c0e9 |