如何在Google App Engine中使用python获得html select选项的值?

如何在Google App Engine中使用python获得html select选项的值?

问题描述:

我正在使用Google App Engine开发Web应用程序。我正在使用Python运行时环境。我也使用Jinja2框架。我的问题是这样的:在我的html页面中,我在表单中有以下标记:

I am working on a web application using Google App Engine. I am using Python Runtime Environment. I am also using Jinja2 framework. The problem I have is this: On my html page, I have the following markup inside a form:

 <select name="word" class="span4">
      <option value="authors" selected>Authors</option>
      <option value="blogs">Blogs</option>
      <option value="bloggers">Bloggers</option>
      <option value="ebooks">Ebooks</option>
      <option value="author">Author</option>
      <option value="writers">Writers</option>
      <option value="kindle">Kindle</option>
 </select>

切换到使用< select option> ,我正在使用< input type =text.... /> ,并且在Python中获取输入值非常简单:

Before switching to using <select option>, I was using <input type="text"..../> and getting the input value inside Python was as simple as :

def post(self):
    word = self.request.get('word')

但现在我无法使脚本工作,因为我无法从用户提交的表单中访问所选值。请帮忙,因为我环顾四周,找不到任何清楚的东西!
谢谢,我期待您的帮助!

but now I cannot get the script to work because I cannot access the selected value from the form submitted by the users. Please help because I have looked around and couldn't find anything clear! Thank you and I look forward to your help!