[web2py] Re: Data entry for list:integer or list:string field

2011-09-08 Thread Noel Villamor
Thanks for this Bruno. I was able to use your code/hint to craft my own specialized validator. lol Noel On Sep 9, 3:06 pm, Bruno Rocha wrote: > class IS_LIST(object): >     def __call__(self, value): >             mylist = value.split(",") >             for item in mylist: >                  v

Re: [web2py] Re: Data entry for list:integer or list:string field

2011-09-08 Thread Bruno Rocha
class IS_LIST(object): def __call__(self, value): mylist = value.split(",") for item in mylist: val, error = IS_INT_IN_RANGE(0,10)(item) if error: return (val, error) return (mylist, None) On Thu, Sep 8,

[web2py] Re: Data entry for list:integer or list:string field

2011-09-08 Thread Noel Villamor
That worked! Thanks Bruno. I wonder now if I can do further validation to ensure that all items are integers and in a specific range. In particular, I wanted to use the already available validator IS_INT_IN_RANGE. Something like: IS_LIST(IS_INT_IN_RANGE(0, 10)) It is hacking time. :) On Se