You may try something like this:
for id in id_list:
query = query | (db.asset_class.id == id)
requires = IS_IN_DB(query,......)
2013/5/2 Domagoj Kovač <[email protected]>
> Hi,
>
> i want to have dynamic query in my IS_IN_DB validator:
> requires = IS_IN_DB(db((db.asset_class.id == 10) |
> (db.asset_class.id == 9) |
> (db.asset_class.id == 7)), 'asset_class.id',
> '%(name)s', zero=T("-- Odaberite --"))
>
> I want to have query like this but, right now my values are hardcoded, how
> can i generate something like (db.asset_class.id == 10) | (db.asset_class.
> id == 9) | (db.asset_class.id == 7)
>
> Lets say that i have a list of ids in available_classes = db(
> db.asset_class.id > 0).select()
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
Att.
Carlos J. Costa
Cientista da Computação
Esp. Gestão em Telecom
EL MELECH NEEMAN!
אָמֵן
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.