How to integrate web.py with WTForms ?

80 views
Skip to first unread message

Leandro Severino

unread,
Oct 25, 2012, 12:07:01 PM10/25/12
to we...@googlegroups.com
Hi,

   How to integrate web.py with WTForms ? are there a sample code ?
   
  Leandro.

Leandro Severino

unread,
Oct 30, 2012, 2:48:56 PM10/30/12
to we...@googlegroups.com
any idea ?

Leandro.

Tomas Schertel

unread,
Aug 28, 2013, 2:31:40 PM8/28/13
to we...@googlegroups.com
Hi Leandro,

Have you figured out how to use wtforms with web.py?
Take a look at this project: https://github.com/faruken/flask-web.py-jvm/blob/master/webpy/app/controllers.py

Sumary:

  def GET(self):
    web.header('Content-Type', 'text/html; charset=UTF-8')
    form = LoginForm()
    return render.index(form)

  def POST(self):
    web.header('Content-Type', 'text/html; charset=UTF-8')
    form = LoginForm(None, web.input())
    if form.validate():
      flag = self.do_login(form.username.data, form.password.data)
      if not flag:
        return render.index(form)
      raise web.seeother('/done?true')
    return render.index(form)

Reply all
Reply to author
Forward
0 new messages