All,
I am trying to have a select (multi select drop down) option in the home
page and display the results on the home page itself(below the select box).
I am able to pull the data from the Table 1 and display in the select box.
I am not able to use the selected options to query Table 2 and display the
results (though I could display all the data from this table) using the
selected options int he select box. My code is below
default.py
def index():
form3 = SQLFORM.factory(Field('select_category',requires=IS_IN_DB(db,
db.table1.id,'%(category)s',multiple=True)))
records = db(db.table2.category_id.belongs(1,2)).select() """I just
tried using 1,2 for testing"""
return dict(form3=form3,records=records,message=T('Info'))
index.html
{{extend 'layout.html'}}
{{=form3}}
{{=records}}
Here form3 has the select box and the button and once I click the button
the result set from the table should be displayed as a list. The code I
have displays all the records from table 2(some of the text is big to be
displayed). Is there a setting where I can display long text also?
Thanks.
--
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/groups/opt_out.