Add dynamic forms #44

wooptoo opened this Issue Feb 16, 2011 · 0 comments


None yet
2 participants

wooptoo commented Feb 16, 2011

A dynamic form class (that allows adding elements dynamically) would be nice:

class DynamicForm(web.form.Form):
    def add_input(self, new_input):
        list_inputs = list(self.inputs)
        self.inputs = tuple(list_inputs)

It can be used like this:

form = DynamicForm()
for k,v in some.items():
    form.add_input(web.form.Checkbox(v, value=k))

anandology was assigned Apr 11, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment