Im trying to create somekind of registration and I ran into 2 problems.
First, I made a form and used some validators and everything went fine
but when I wanted to add FieldsMatch(for checking if passwords match)
validator I couldn't find a way.
Second, I need to check if someone has already registered under desired
username and I have no idea how to make this.
Ok my code:
class RegisterFields(widgets.WidgetsList):
username = widgets.TextField(name="username", label="Username:",
validator=validators.NotEmpty())
password = widgets.PasswordField(name="password",
label="Password:",
validator=validators.NotEmpty())
password2 = widgets.PasswordField(name="password2", label="Password
x2:",
validator=validators.NotEmpty())
email = widgets.TextField(name="email", label="E-mail:",
validator=validators.Email(not_empty=True))
firstname = widgets.TextField(name="firstname", label="Firstname:",
validator=validators.NotEmpty())
lastname = widgets.TextField(name="lastname", label="Lastname:",
validator=validators.NotEmpty())
register_form = widgets.TableForm(fields=RegisterFields(),
submit_text="Register")
@expose()
@validate(form=register_form)
@error_handler(register)
def registerform(self, username, password, password2, email,
firstname, lastname):
return username +" "+ password +" "+ email +" "+ firstname +"
"+ lastname
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---