El Sábado, 11 de Marzo de 2006 19:17, Robin Haswell escribió:
> Hey guys
>
> I'm having difficulty validating fieldsets. I know why this is wrong, I
> just don't know how I can make it work. Does anyone have any input? Cheers
>
> class AccountFields(widgets.WidgetsDeclaration):
>       userId = widgets.TextField(label="Username")
>       password = widgets.PasswordField(label="Password")
>       emailAddress = widgets.TextField(label="E-mail address")
>
> class PersonalFields(widgets.WidgetsDeclaration):
>       displayName = widgets.TextField(label="What do you like to be called?")
>       firstname = widgets.TextField(label="First name")
>       lastname = widgets.TextField(label="Last name")
>
> class RegisterForm(widgets.WidgetsDeclaration):
>       account = widgets.FieldSet(legend="Account", fields=AccountFields())
>       personal = widgets.FieldSet(legend="Personal", fields=PersonalFields())
>
> class Root(controllers.RootController):
>       ...
>       @turbogears.expose(html=".templates.register")
>       @turbogears.validate(form=RegisterForm())
>       def register(self):
>               return dict(form=widgets.FieldSetForm(fields=RegisterForm(),
> submit_text="Register"))
>
> Obviously I get:
>
> AttributeError: 'RegisterForm' object has no attribute 'validate'
>
> Personally I don't think this is solvable, but I'd love to be proved wrong
> :-) Maybe I need to leave fieldsets until documentation is complete
>
> Cheers
>
> -Rob
>

in the list in Spanish, there is a similar example working
to perhaps it serves you

http://groups.google.com/group/TurboGears-es/browse_thread/thread/50aa92d9dbe1c91e/545ac69ac18176b1


-- 
Marcelo Ametller
www.maram.com.ar

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to