Functions | |
- to be used in exception handling, identification that will be used to the output | |
This module is a control/validation module with all the different validations on both user input and database input for all different data types. To prevent from trying to add "illegal" data to the database. Validates string input to the given conditions. Parameters: to the user so he/she will understand what/where went wrong. - string to be validated - the max length of the string, -1 means no limit - if the string can have length of zero; boolean true or false - a python regular expression mask, if the string needs to have a special syntax
!Return: If the string satisfy the given conditions it is returned, else and exception is thrown. | |
def | ValidateString |
def | ValidateNumber |
def | ValidateSystem |
def Validation::ValidateNumber | ( | name, | ||
thenumber, | ||||
minvalue = None , |
||||
maxvalue = None , |
||||
allowdecimal = False | ||||
) |
Validates a number with the given constraints.
Input: - the smallest value allowed - the biggest value allowed - whether decimal (float) numbers are allowed or not
!Return: True is returned if validation was successful, else we throw an exception.
Definition at line 61 of file Validation.py.
def Validation::ValidateString | ( | name, | ||
thestring, | ||||
maxlength = -1 , |
||||
allowzerolength = False , |
||||
regexprmask = "" | ||||
) |
Definition at line 27 of file Validation.py.
def Validation::ValidateSystem | ( | name, | ||
thesystem | ||||
) |
Test if the systemname is valid, we have 12 different names to test against; set in the cdbVisCore. Case-sensitive.
Parameters: - name of the system
!Return: The name of the system itself if legal, or an exception is thrown otherwise
Definition at line 101 of file Validation.py.