[web2py] Re: problem with belongs

2010-03-29 Thread Richard
Try this: animals = request.vars.animals if not isinstance(animals, list): animals = [animals] res = db(db.table.field.belongs(animals)).select(db.table.ALL) On Mar 29, 10:59 pm, pacopyc wrote: > With this code works, but I don't like this: > > if type(animals) == str: >   res = db(db.tabl

[web2py] Re: problem with belongs

2010-03-29 Thread pacopyc
With this code works, but I don't like this: if type(animals) == str: res = db(db.table.field==animals).select(db.table.ALL) else: res = db(db.table.field.belongs(animals)).select(db.table.ALL) Can you say me a better method? Thank you On 29 Mar, 13:29, pacopyc wrote: > Hi, I've a problem