I think it would be much better if you didn't have to name your inputs
twice:

class MyForm(form):
    name = form.Textbox()
    password = form.Password()
    password2 = form.Password()



On Oct 20, 9:09 pm, Daniel Garcia Moreno <[email protected]> wrote:
> Hi everyone, I've been thinking about web.py forms, and I realize that
> it could be great if you could define a form defining a class. Something
> like that:
>
> from web import form
>
> class MyForm(form):
>     name = form.Textbox('name')
>     password = form.Password('password')
>     password2 = form.Password('password2')
>
>     validator1 = form.Validator("Passwords didn't match.", lambda i:
> i.password == i.password2)
>
> and then use like normal web.py form:
>
> f = MyForm()
> f.render()
> ...
> f.validates()
> ...
>
> I write a patch to make that avaliable in current web.py.
>
> What do you think about that?
>
>  0001-Allow-declare-forms-using-inheritance.patch
> 1KViewDownload

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to