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
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---