Friends,
How create a form.Dropdown() control that run in GAE?
I have this code that don't run in GAE:
# in the forms.py
result = data.all_categories() # this method return all records of
table category in GAE/big table format.
args = [(row.key().id(), row.title) for row in result]
new_post = form.Form(
form.Dropdown('category', args),
form.Textbox('title'),
form.Textarea('text'),
form.Dropdown('language', [('pt', 'Portuguese'), ('en',
'English')]),
form.Button('Submit!')
# in app.py
class Post:
def GET(self):
frm = forms.new_post()
return render.full(render.form(frm))
def POST(self):
global last_updated
frm = forms.new_post()
if frm.validates():
data.save_entry(frm.d)
last_updated = data.last_updated()
raise web.seeother('/')
else:
return render.full(render.form(frm))
-- Leandro.
--
You received this message because you are subscribed to the Google Groups "web.py" group.
To post to this group, send email to
we...@googlegroups.com.
To unsubscribe from this group, send email to
webpy+un...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/webpy?hl=en.