That works, thanks.
On Wednesday, 20 August 2014 15:30:26 UTC, Niphlod wrote:
>
> isn't IS_IN_DB enough when you specify a set ?, e.g.
> IS_IN_DB(db(db.other_table.field == True), 'other_table.id', '%(name)s') ?
>
> On Wednesday, August 20, 2014 5:26:29 PM UTC+2, sasogeek wrote:
>>
>> I don't know if the title of the question makes any sense but here's what
>> I want to achieve. In the model db.py, i can have a field that references
>> another table via Field('fieldname', db.other_table), but this gives me a
>> select html element in the views which has all the items in the
>> other_table. if I want only some specific items in other_table where for
>> instance other_table.field==True, can i do that directly from the db.py? if
>> so, how? my workaround now is to do this directly in the views where for
>> item in other_table_items, if item.field==True <option value={{=item.id
>> }}>{{=item.name}}</option>
>>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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/d/optout.