loading animation after form

24 views
Skip to first unread message

Moreno Versolatto

unread,
Aug 19, 2015, 12:39:25 PM8/19/15
to web.py
hi,
i'm a beginner with web.py and i need some help.
After processing user input i want to appear an animation (a loader with css), processing data from a form (it takes some while) and then i want to redirect them to another page.

how i can do this?

here the code:

import web
from web import form

render = web.template.render('templates/')

myform = form.Form(
  form.Textbox("Target",
               form.notnull,
              size="55"),
  )

urls = (
    '/', 'index'
)
app = web.application(urls, globals())

class index:
    def GET(self):
      form = myform()
      return render.index(form)
   
    def POST(self):
        form = myform()
        if not form.validates():
          return render.index(form)
        else:
          #
          # HERE THE ANIMATION IN INDEX PAGE
          # PROCESS DATA
          # REDIRECT RESULTS IN OTHER PAGE
          #
 
if __name__ == "__main__":
    app = web.application(urls, globals())
    app.run()
Reply all
Reply to author
Forward
0 new messages