pyrtma.validators.ArrayField
- class ArrayField(validator, len)[source]
Bases:
FieldValidator
,Sequence
,Generic
[_FV
]Array field validator base class
Array field validator base class
- Parameters:
validator (Type[_FV]) – Field validator class for datatype
len (int) – Field length
Methods
Raises ValueError if the value is not present.
Validate array
Validate multiple values
Validate one value
- count(value) integer -- return number of occurrences of value
- index(value[, start[, stop]]) integer -- return first index of value.
Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- validate_array(value)[source]
Validate array
- Parameters:
value (ArrayField) – Array value to validate
- Raises:
TypeError – Wrong type