We have two tables:
----------------------------
db.define_table('t_company',
Field('f_name'))
db.define_table('t_person',
Field('f_company_id', db.t_company),
Field('f_name'))
crud.create(db.person) --> 'f_company_id' is rendered as select/
options html tag
-------------------------------------------------------------------------------------------------------------------------
<select class="reference" id="t_person_f_company_id"
name="f_company_id">
<option value=""/>
<option value="2">COMPANY 1</option>
.....
crud.search(db.person...) --> 'f_company_id' is rendered as an input
html tag
------------------------------------------------------------------------------------------------------------------------
<input class="reference t_company" id="txtf_company_id"
name="txtf_company_id" type="text"/>
.....
I want crud.search to render 'reference' fields as select/options tag,
such as crud.create
So i tried setting widget explicitily:
db.t_person.f_company_id.widget=SQLFORM.widgets.options.widget
I did it at form level, at DB level, and on the controller, with no
success
What am I doing wrong?