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.1.tar.gz
(7.0 kB
view hashes)
Built Distribution
Close
Hashes for SmileValidation-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8aeecc397df724401cb9150da28771c833d096499e86c27e52f5a1866577aa7e |
|
MD5 | aa038829c0680d373b7651c726b585d4 |
|
BLAKE2b-256 | d83d2dc91a0181b1854b94cdf84a1757e0050597c0ba4045f409f170f33921b5 |