If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!


  • 0
    select  14 years ago
    thanks i was wating for this, since i was too lazy to read into it myself, and it is nice that it needs not extra jquery plugin if you want to find close matches (grmnay -> germany) instead of substrings (erma -> germany) you could add something like all_items = cache.ram( 'alltitles', lambda: dict( [(x.printable_name.lower(), x.id ) for x in db(dbcountry.id>0).select()]), time_expire=60) filtered_close = difflib.get_close_matches(query,all_items) for (i,country) in enumerate([db.country[all_items[t]] for t in filtered_close]): well somehting along the lines but i guess you get the idea

Commented on:

This is a very easy way to make an ajax live search using JQuery , xHTML , CSS and Web2Py on the server side ;-)

Hosting graciously provided by:
Python Anywhere