#!/usr/bin/python
from albatross import SimpleApp
from albatross.cgiapp import Request


class Form:

    def page_enter(self, ctx):
        ctx.locals.text = ctx.locals.singleton = ctx.locals.group = \
                          ctx.locals.radio = ctx.locals.select = None
        ctx.locals.num = 0
        ctx.add_session_vars('num')

    def page_display(self, ctx):
        ctx.locals.num += 1
        ctx.run_template('form.html')


app = SimpleApp(base_url='form.py',
                template_path='.',
                start_page='form',
                secret='-=-secret-=-')
app.register_page('form', Form())


if __name__ == '__main__':
    app.run(Request())
