自动完成文本框示例在python +谷歌应用程序引擎 [英] Autocomplete Textbox Example in python + Google app engine
问题描述
有关我的谷歌应用程序引擎的应用程序,我需要包括autocompleter文本框将显示名称开头的文本框value.And的名字将检索从谷歌应用程序引擎的数据存储。
For my google app engine application, I need to include a autocompleter Textbox which will show the name starting with the textbox value.And the name will retrieve from the google app engine datastore.
任何好的教程或样品code吧。
Any good tutorial or sample code please.
更新:请回答这个
我创建了一个示例HTML code: dl.dropbox.com/ U / 7384181 /自动完成/ autocomplete.html 。 在此HTML页面中我已经创建文本框dinamically.So目前我给你自动完成的第一个文本框(txtProduct1)只。我如何分配中的自动完成剩下的所有文本,这是会动态创建?
I created a sample HTML code : dl.dropbox.com/u/7384181/autocomplete/autocomplete.html . In this html page i have creating the textbox dinamically.So currently i assign the autocomplete in the first textbox(txtProduct1) only. How do i assign the autocomplete in rest all the textbox which is going to create dynamically ?
推荐答案
您可以看看jQuery的自动完成这里一>
You can have a look at the jquery auto complete here
HTML:
$("#search_users").autocomplete(/search/search_manager);
蟒蛇控制器
jQuery的自动完成插件默认使用变量Q
jquery autocomplete plugin by default uses variable q
class search_user(webapp.RequestHandler):
q = (self.request.GET['q']).lower()
results=models.user.all().fetch(100)
for records in result:
print records+"|"+records+"\n"
application = webapp.WSGIApplication([
(r'/user_auth/search_manager',search_user)]
def main():
run_wsgi_app(application)
if __name__ == '__main__':
main()
simple:
应用自动完成的一类 $
Apply the autocomplete to a class $
(".search_users").autocomplete(/search/search_manager);
这篇关于自动完成文本框示例在python +谷歌应用程序引擎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!