noooo...

class IS_LIST():
     def __call__(self,value):
          return ([x.strip() for x in value.split(',')],None)
     def formatter(self,value):
          return ', '.join(value)

Field('mylist',gae.StringListProperty(),requires=IS_LIST())

On Feb 17, 8:38 pm, Richard <[email protected]> wrote:
> On Feb 18, 9:52 am, Wes James <[email protected]> wrote:
>
> > So I have been working on a validator and trying to simply make a list
> > from a string.
>
> > a="['a','b']"
>
> > b=a[1:-1].split(',')
>
> > returns
>
> > [ " 'a' "," 'b' " ]
>
> > Is there a simpler way?
>
> eval?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to