David Pratt wrote:
> Hi Kent. Thank you for your reply. I gave this a go but get the
> following traceback:
> ...
> result = validator(name, value)
> TypeError: 'str' object is not callable
>
> Have put validators in list and iterate over it as in following:
>
> validator_list =
> [is
George Sakkis wrote:
> That's a typical case for using an OO approach; just make a class for
> each validator and have a single polymorphic validate method (I would
> make validators __call__able instead of naming the method 'validate'):
>
> # Abstract Validator class; not strictly necessary but g
Cool! Many thanks George. Yes this is the way to go - objects. Much
better :-)
On Sunday, June 5, 2005, at 02:49 PM, George Sakkis wrote:
> David Pratt wrote:
>> Hi. I am creating methods for form validation. Each validator has its
>> own method and there quite a number of these. For each fi
Hi Kent. Thank you for your reply. I gave this a go but get the
following traceback:
...
result = validator(name, value)
TypeError: 'str' object is not callable
Have put validators in list and iterate over it as in following:
validator_list =
[isContainedIn,isDate,isDecimal,isEma
David Pratt wrote:
> Hi. I am creating methods for form validation. Each validator has its
> own method and there quite a number of these. For each field, I want
> to evaluate errors using one or more validators so I want to execute
> the appropriate validator methods from those available. I am
David Pratt wrote:
> Hi. I am creating methods for form validation. Each validator has its
> own method and there quite a number of these. For each field, I want to
> evaluate errors using one or more validators so I want to execute the
> appropriate validator methods from those available. I