ids = []
names = []
for r in rows:
   ids.append(r.id)
   names.append(r.name)

db.table.multilist_field.requires=IS_IN_SET(ids, names)

--
Thadeus





On Mon, Jun 28, 2010 at 10:49 AM, weheh <[email protected]> wrote:
> I have a multilist that I want to populate from db.table:
>
>    rows=db(query).select(db.table.id,db.table.name)
>
>    db.table.multilist_field.requires=IS_IN_SET(
>        [r.id for r in rows],
>        labels=[r.name for r in rows],
>        )
>
> Is there a better, more efficient way to do this rather than having to
> run through the rows list twice?
>

Reply via email to