The problem is that when you autocomplete you may have lots of records so search has to be done based on DB content. If you were to use virtual fields (computed on the fly by web2py) the search would be done client-side in memory. It would be faster but would not work for large record sets.
Massimo On Aug 9, 5:06 am, villas <[email protected]> wrote: > Thanks Massimo, I can do that. Only slight issue is the computed > field physically takes space in the database. > > I was a bit puzzled why a virtualfield would not work because I > thought it was introduced for precisely this kind of use. > -- > D > > On Aug 9, 1:54 am, mdipierro <[email protected]> wrote: > > > You must have computed field that contains the contend you want to use > > 'name + town' > > > On Aug 8, 7:06 pm, villas <[email protected]> wrote: > > > > I have the following requirements: > > > > 1) The widget to show the 'name' but save the 'id' > > > 2) The widget to reveal the fields 'name' plus 'town' in the drop down > > > selection. > > > > The built-in autocomplete widget provides 1) but I cannot see how to > > > do 2). > > > > The code in sqlhtml.py seems rather complex. I tried to use a > > > virtualfield to join the two fields together and show that, but it > > > does not seem to work. > > > > Mr Freeze's slice 66 seems like it might be easier to adapt, but I > > > would need to add both requirements, which is still probably beyond my > > > skills. > > > (http://www.web2pyslices.com/main/slices/take_slice/66) > > > > Can anyone give me a pointer, thanks. > > > -- > > > David

