If you validator is IS_IN_SET(...,multiple=True)

the single value in request.vars.receivers becomes a list in
form.vars.receivers. You should use

form.vars.receivers

On Apr 14, 7:53 am, Kenneth Lundström <kenneth.t.lundst...@gmail.com>
wrote:
> Well, to answer my own question,
>
> if isinstance(request.vars.receivers, list):
>      db(db.members.id.belongs(request.vars.receivers)).select()
> else:
>      db(db.members.id==request.vars.receivers)).select()
>
> Probably there is a nicer solution but this works.
>
> Kenneth
>
>
>
>
>
>
>
> > Hello,
>
> > I have a very stupid problem.
>
> > I created a list of users with a SELECT/OPTION tag and I have multiple
> > as true. I can select as many members I like and with belongs I can
> > fetch all members like selected =
> > db(db.members.id.belongs(request.vars.receivers)).select()
> > Every option has a value that is the members id.
>
> > This works if I select more than one member, but if I select just one
> > member it doesn t work.
>
> > I think the problem is that if I select 2 och more members the
> > request.vars.receivers is a list of members, if I select just one
> > member the variable is a value.
>
> > I have a feeling the is really simple, but can t get it to work.
>
> > Kenneth

Reply via email to