IS_IN_DB(rows, '%(id)s', '%(name)s')

--
Thadeus





On Mon, Jun 28, 2010 at 11:35 AM, Thadeus Burgess <thade...@thadeusb.com> wrote:
> 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 <richard_gor...@verizon.net> 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