class RegisterForm(Form): fullname = TextField('Full name', [ validators.Length( min=3, max=35, message="Full name must be between 3 and 35 characters long") ]) username = TextField('User name', [ validators.Length( min=3, max=35, message="User name must be between 3 and 35 characters long"), Unique(model.Session, model.User, model.User.name, message="The user name is already taken") ]) email_addr = TextField('Email Address', [ validators.Length( min=3, max=35, message="Email must be between 3 and 35 characters long"), validators.Email(), Unique(model.Session, model.User, model.User.email_addr, message="Email is already taken") ]) password = PasswordField('New Password', [ validators.Required(message="Password cannot be empty"), validators.EqualTo('confirm', message='Passwords must match') ]) confirm = PasswordField('Repeat Password')
class UpdateProfileForm(Form): id = IntegerField(label=None, widget=HiddenInput()) fullname = TextField('Full name', [ validators.Length( min=3, max=35, message="Full name must be between 3 and 35 characters long") ]) name = TextField('User name', [ validators.Length( min=3, max=35, message="User name must be between 3 and 35 characters long"), Unique(model.Session, model.User, model.User.name, message="The user name is already taken") ]) email_addr = TextField('Email Address', [ validators.Length( min=3, max=35, message="Email must be between 3 and 35 characters long"), validators.Email(), Unique(model.Session, model.User, model.User.email_addr, message="Email is already taken") ])
class FormClient(wtf.Form): name = wtf.StringField( label='Nom du Client :', validators=[validators.Required('Champ Obligatoire')]) ref = wtf.StringField(label='Ref :', validators=[ validators.Required('Champ Obligatoire'), unique_reference ]) bp = wtf.StringField(label='Boite Postal :', validators=[validators.Required('Champ Obligatoire')]) adresse = wtf.TextAreaField( label='Adresse :', validators=[validators.Required('Champ Obligatoire')]) ville = wtf.StringField( label='Ville :', validators=[validators.Required('Champ Obligatoire')]) pays = wtf.StringField( label='Pays :', validators=[validators.Required('Champ Obligatoire')]) email = wtf.StringField(label='Email :', validators=[ validators.Required('Champ Obligatoire'), unique_email_validator, validators.Email('Email invalide') ]) phone = wtf.StringField( label='Telephone :', validators=[validators.Required('Champ Obligatoire')]) id = wtf.HiddenField()
class RegisterForm(Form): err_msg = lazy_gettext( "Full name must be between 3 and 35 characters long") fullname = TextField(lazy_gettext('Full name'), [validators.Length(min=3, max=35, message=err_msg)]) err_msg = lazy_gettext( "User name must be between 3 and 35 characters long") err_msg_2 = lazy_gettext("The user name is already taken") username = TextField(lazy_gettext('User name'), [ validators.Length(min=3, max=35, message=err_msg), pb_validator.NotAllowedChars(), pb_validator.Unique(db.session, model.User, model.User.name, err_msg_2) ]) err_msg = lazy_gettext("Email must be between 3 and 35 characters long") err_msg_2 = lazy_gettext("Email is already taken") email_addr = TextField(lazy_gettext('Email Address'), [ validators.Length(min=3, max=35, message=err_msg), validators.Email(), pb_validator.Unique(db.session, model.User, model.User.email_addr, err_msg_2) ]) err_msg = lazy_gettext("Password cannot be empty") err_msg_2 = lazy_gettext("Passwords must match") password = PasswordField(lazy_gettext('New Password'), [ validators.Required(err_msg), validators.EqualTo('confirm', err_msg_2) ]) confirm = PasswordField(lazy_gettext('Repeat Password'))
def validate(form, field): if field.data == '': return if '@' not in field.data: raise ValidationError("Invalid e-mail address.") v = validators.Email() v(form, field)
class MainUpdateUserForm(wtf.Form): fname = wtf.TextField('First Name*', [validators.Required()]) mname = wtf.TextField('Middle Name', [validators.Optional()]) lname = wtf.TextField('Last Name*', [validators.Required()]) avatar = wtf.TextField( 'Gravatar Email', [validators.Optional(), validators.Email()])
class RegistrationForm(Form): username = TextField('Username', [ validators.Required(), validators.Length( min=3, max=30, message='Username must be %(min)d - %(max)d chars'), validators.Regexp( '^[A-Za-z0-9\-_]+$', message= 'Username may only contain letters, numbers, dashes and underscores' ) ]) email = TextField('Email', [ validators.Required(), validators.Email(), validators.Length(max=255) ]) password = PasswordField('Password', [ validators.Required(), validators.EqualTo('password_confirm', message='Passwords did not match') ]) password_confirm = PasswordField('Confirm Password') submit = SubmitField('Register') def validate_username(form, field): user = models.User.query.filter_by(username=field.data).all() if user: raise ValidationError, 'Username already exists'
class ForgotPasswordForm(Form): """Form Class for forgotten password.""" err_msg = lazy_gettext("Email must be between 3 and 35 characters long") email_addr = TextField(lazy_gettext('Email Address'), [validators.Length(min=3, max=35, message=err_msg), validators.Email()])
class NewStudentForm(wtf.Form): name = wtf.TextField('Name', validators=[validators.Optional()]) email = wtf.TextField( 'Email', validators=[validators.Required(), validators.Email()]) graduation_year = wtf.TextField('Graduation year', validators=[validators.Optional()]) preferences = MultiCheckboxField('Preferences', choices=zip(models.SUBJECTS, models.SUBJECTS), validators=[validators.Optional()])
class EditUserForm(Form): email = TextField("email", [ validators.Length(min=6, max=35), validators.Email(message="Not a valid email address"), Unique(User, User.email) ]) password = PasswordField("New password", [ validators.Required(), validators.EqualTo("confirm", message="Passwords must match") ]) confirm = PasswordField("Confirm new password")
class FormLogin(wtf.Form): email = wtf.StringField(label='Adresse Email', validators=[ validators.Email('Adresse Email invalide'), validators.Required('Information obligatoire') ]) password = wtf.PasswordField( label='Mot de passe', validators=[ validators.Required('Information obligatoire'), password_validator ])
class ContactForm(Form): name = TextField("Name", [validators.Required("Please, enter your name.")]) email = TextField("Email", [ validators.Required("Please enter your email address."), validators.Email("Please enter valid email address.") ]) subject = TextField("Subject", [validators.Required("Please enter a subject.")]) message = TextAreaField("Message", [validators.Required("Please enter a message.")]) submit = SubmitField("Send")
class RegistrationForm(Form): email = TextField("email", [validators.Email(message="Not a valid email address")]) username = TextField( "username", [validators.Length(min=6), Unique(User, User.username)]) password = PasswordField("Password", [ validators.Required(), validators.EqualTo("Confirm", message="Passwords must match") ]) confirm = PasswordField("Repeat Password") recaptcha = RecaptchaField()
class CreateUserForm(wtf.Form): fname = wtf.TextField('First Name*', [validators.Required()]) mname = wtf.TextField('Middle Name', [validators.Optional()]) lname = wtf.TextField('Last Name*', [validators.Required()]) cwruid = wtf.TextField('CWRU ID*', [validators.Required()]) family = wtf.SelectField('Family', [validators.Optional()]) big = wtf.TextField('Big CWRU ID', [validators.Optional()]) avatar = wtf.TextField( 'Gravatar email', [validators.Email(), validators.Optional()]) # need to make the role list change according to the roles in the database roles = wtf.SelectMultipleField('Role Name', [validators.Optional()])
class FormMag(wtf.Form): id = wtf.HiddenField() name = wtf.StringField(label='Point de vente :', validators=[validators.Required('Nom du magasin obligatoire'), unique_name_validator]) biographic = wtf.TextAreaField(label='Bio du point de vente :') adresse = wtf.StringField(label='Adresse :') ville = wtf.StringField(label='Ville :') phone = wtf.StringField(label='Telephone :') email = wtf.StringField(label='Adresse Email :', validators=[validators.Required('Adresse courriel obligatoire'), validators.Email('Adresse email invalide') ])
class UserSettingsForm(Form): password = PasswordField('Current Password', [validators.Required()]) email = TextField('Email', [ validators.Required(), validators.Email(), validators.Length(max=255) ]) new_password = PasswordField('New Password', [ validators.Optional(), validators.EqualTo('new_password_confirm', message='New passwords did not match') ]) new_password_confirm = PasswordField('Confirm New Password') submit = SubmitField('Change Settings')
class FormUser(wtf.Form): id = wtf.HiddenField() first_name = wtf.StringField( label='Nom', validators=[validators.Required('Information obligatoire')]) last_name = wtf.StringField(label='Prenom') email = wtf.StringField(label='Adresse Email', validators=[ validators.Email('Adresse email invalide'), validators.Required('Information obligatoire'), unique_email_validator_2 ]) phone = wtf.StringField(label='Telephone') appareil = wtf.SelectMultipleField(label='Appareil', coerce=str) categorie = wtf.SelectMultipleField(label='Departement', coerce=str)
class FormCompany(wtf.Form): name = wtf.StringField( label='Nom de la societe :', validators=[validators.Required(message='Champs Obligatoire')]) bp = wtf.StringField(label='Boite Postal :') adress = wtf.StringField( label='Adresse :', validators=[validators.Required(message='Champs Obligatoire')]) ville = wtf.StringField( label='Ville :', validators=[validators.Required(message='Champs Obligatoire')]) pays = wtf.StringField(label='Pays :') phone = wtf.StringField( label='Numero Telephone :', validators=[validators.Required(message='Champs Obligatoire')]) capital = wtf.StringField(label='Capital social :') numcontr = wtf.StringField( label='Numero du contribuable', validators=[validators.Required(message='Champs Obligatoire')]) registcom = wtf.StringField( label='Registre du commerce', validators=[validators.Required(message='Champs Obligatoire')]) email = wtf.StringField( label='Adresse mail', validators=[ validators.Required(message='Champs Obligatoire'), validators.Email('Email invalide') ]) siteweb = wtf.StringField( label='Site Web', validators=[validators.Required(message='Champs Obligatoire')]) slogan = wtf.StringField(label='Slogan/Breve description :') typEnt = wtf.StringField( label='Selectionnez le type :', validators=[validators.Required(message='Champs Obligatoire')]) facebook = wtf.StringField( label='Lien facebook :', validators=[validators.Required(message='Champs Obligatoire')]) twitter = wtf.StringField( label='Lien twitter :', validators=[validators.Required(message='Champs Obligatoire')]) quartier = wtf.StringField( label='Quartier :', validators=[validators.Required(message='Champs Obligatoire')]) emailNotification = wtf.StringField(label='Email Notification :') senderNotification = wtf.StringField(label='Sender Notification :')
class FormCompte(wtf.Form): id = wtf.HiddenField() nameCompagny = wtf.StringField(label='Nom Entreprise :', validators=[validators.Required('Nom de l\'entreprise obligatoire')]) notification_email = wtf.StringField(label='Adresse Email :', validators=[validators.Required('Information obligatoire'), validators.Email('Adresse email invalide'), unique_email_validator]) phone = wtf.StringField(label='Telephone :', validators=[validators.Required('Information du telephone obligatoire')]) pays = wtf.StringField(label='Pays :', validators=[validators.Required('Information du pays obligatoire')]) ville = wtf.StringField(label='Ville :', validators=[validators.Required('Information de la ville obligatoire')]) adresse_un = wtf.StringField(label='Adresse 1 :') adresse_deux = wtf.StringField(label='Adresse 2 :') siteweb = wtf.StringField(label='Site Web :') facebook_link = wtf.StringField(label='Lien Facebook :') twitter_link = wtf.StringField(label='Lien twitter :') instagramm = wtf.StringField(label='Lien instagramm :') devise = wtf.StringField(label='Devise :')
class FormContact(wtf.Form): first_name = wtf.StringField( label='Nom du contact :', validators=[validators.Required('Champ Obligatoire')]) last_name = wtf.StringField( label='Prenon du contact :', validators=[validators.Required('Champ Obligatoire')]) email = wtf.StringField(label='Adresse Email', validators=[ validators.Required('Champ Obligatoire'), validators.Email('Email invalide') ]) phone1 = wtf.StringField(label='Telephone mobile :', validators=[numeric]) phone2 = wtf.StringField(label='Telephone fixe :', validators=[numeric]) client_id = wtf.SelectField(label='Client du contact :', coerce=str, validators=[client_id_required]) contact = wtf.HiddenField(default=None)
class FormUser(wtf.Form): id = wtf.HiddenField() user = wtf.HiddenField() first_name = wtf.StringField( label='Prenom', validators=[validators.Required('Information obligatoire')]) last_name = wtf.StringField( label='Nom', validators=[validators.Required('Information obligatoire')]) email = wtf.StringField(label='Adresse Email', validators=[ validators.Email('Email non valid'), validators.Required('Information obligatoire'), unique_email_validator ]) fonction = wtf.StringField(label='Fonction :') phone = wtf.StringField(label='Telephone Mobile :') note = wtf.TextAreaField(label='Note interne :')
class RegistrationForm(LoginForm): email = EmailField('Email Address', [ validators.Required(), validators.Length(min=6, max=64), validators.Email(u'Invalid Email Address') ]) name = TextField('Full Name (Optional)', [ validators.Optional(), validators.Length(min=2, max=64)]) phone = TextField('Phone Number', [ validators.Optional(), validators.Length(min=5, max=20)]) password = PasswordField('New Password', [ validators.Required(), validators.EqualTo('confirm', message='Passwords must match') ]) confirm = PasswordField('Repeat Password') admin = BooleanField('Make me an Admin')
class UpdateProfileForm(Form): """Form Class for updating PyBossa's user Profile.""" id = IntegerField(label=None, widget=HiddenInput()) err_msg = lazy_gettext("Full name must be between 3 and 35 " "characters long") fullname = TextField(lazy_gettext('Full name'), [validators.Length(min=3, max=35, message=err_msg)]) err_msg = lazy_gettext("User name must be between 3 and 35 " "characters long") err_msg_2 = lazy_gettext("The user name is already taken") name = TextField(lazy_gettext('User name'), [validators.Length(min=3, max=35, message=err_msg), pb_validator.NotAllowedChars(), pb_validator.Unique( db.session, model.User, model.User.name, err_msg_2)]) err_msg = lazy_gettext("Email must be between 3 and 35 characters long") err_msg_2 = lazy_gettext("Email is already taken") email_addr = TextField(lazy_gettext('Email Address'), [validators.Length(min=3, max=35, message=err_msg), validators.Email(), pb_validator.Unique( db.session, model.User, model.User.email_addr, err_msg_2)]) locale = SelectField(lazy_gettext('Default Language')) ckan_api = TextField(lazy_gettext('CKAN API Key')) def set_locales(self, locales): """Fill the locale.choices.""" choices = [] for locale in locales: if locale == 'en': lang = gettext("English") if locale == 'es': lang = gettext("Spanish") if locale == 'fr': lang = gettext("French") choices.append((locale, lang)) self.locale.choices = choices
class SignupForm(Form): username = f.TextField('Username', [ v.Length(min=3, max=128), v.Regexp(r'^[^@]*$', message="Username shouldn't be an email address") ]) email = html5.EmailField('Email address', [ v.Length(min=3, max=128), v.Email(message="This should be a valid email address.") ]) password = f.PasswordField('Password', [ v.Required(), v.Length( min=8, message= "It's probably best if your password is longer than 8 characters." ), v.EqualTo('confirm', message="Passwords must match.") ]) confirm = f.PasswordField('Confirm password') # Will only work if set up in config (see http://packages.python.org/Flask-WTF/) captcha = f.RecaptchaField('Captcha')
class FormRegister(wtf.Form): id = wtf.HiddenField() name = wtf.StringField( label='Nom Entreprise', validators=[validators.Required('Nom de l\'entreprise obligatoire')]) email = wtf.StringField(label='Adresse Email', validators=[ validators.Required('Information obligatoire'), validators.Email('Adresse email invalide'), unique_email_validator ]) password = wtf.PasswordField( label='Mot de passe', validators=[ validators.Required('Mot de passe obligatoire'), password_validator ]) retype_password = wtf.PasswordField( label='Confirmation du mot de passe', validators=[ validators.EqualTo( 'password', message='Les deux mots de passe sont differents') ]) phone = wtf.StringField( label='Telephone', validators=[ validators.Required('Information du telephone obligatoire') ]) pays = wtf.StringField( label='Pays', validators=[validators.Required('Information du pays obligatoire')]) ville = wtf.StringField( label='Ville', validators=[ validators.Required('Information de la ville obligatoire') ]) adresse_un = wtf.StringField(label='Adresse 1') adresse_deux = wtf.StringField(label='Adresse 2')
class FormRegisterUserAdmin(wtf.Form): first_name = wtf.StringField( label='Prenom', validators=[validators.Required('Information obligatoire')]) last_name = wtf.StringField( label='Nom', validators=[validators.Required('Information obligatoire')]) email = wtf.StringField(label='Adresse Email', validators=[ validators.Email('Email non valid'), validators.Required('Information obligatoire'), unique_email_validator ]) password = wtf.PasswordField( label='Mot de passe', validators=[ validators.Required('Information obligatoire'), password_validator ]) retype_password = wtf.PasswordField( label='Confirmation du mot de passe', validators=[ validators.EqualTo( 'password', message='Les deux mots de passe sont differents') ])
class EmailAddressForm(wtf.Form): emailName = wtf.TextField('Name', [validators.Optional()]) emailAddress = wtf.TextField( 'Email', [validators.Required(), validators.Email()]) key = wtf.HiddenField([validators.Optional()])
class ContactForm(wtf.Form): email = wtf.StringField('Votre e-mail', validators=[validators.Email()]) message = wtf.TextAreaField(u"Le message à envoyer à l'AFCP :", validators=[validators.InputRequired()])
class ForgotPasswordForm(Form): email_addr = TextField('Email Address', [validators.Length(min=3, max=35, message="Email must be between 3 and 35 characters long"), validators.Email(), ])