I have found a solution on it.

steps:

1. create a view in the db - usin union selects
2. create a fake db - migrate = False
3. use the SQLFORM autocomplete as normal, ref the fake db. the fake db have
to be set up before the db were the autocomplete widget is used.

that's it.



I have found a workaround to the problem by using
sqlform.widget.autocomplete. that is working for 1 column. problem is that i
would like to search in 3 columns. I can work around that by creating a view
in the databasee (also belive it will be more efficient) by using union
selects on the tre columns. that is working fine, but I cant get access to
the view from web2py. I tried to make a "fake" table" with to fields and
Migrate=False, but it looks in the db.table



On Tue, Dec 7, 2010 at 6:00 PM, Ole Martin Maeland <[email protected]>wrote:

> Hi,
>
> I would like to create a form were I get a dropdown list that search 3 rows
> in one table. it should then pick the .id field for the record.
>
> It would be similar to the ajax search with autocomplete:
> http://web2pyslices.com/main/slices/take_slice/51
>
> I could use that, but how do I "embed" it in a SQLFORM ??
>
> Any Idea ??
>
> regards
> Martin
>

Reply via email to