class PostForm(Form): title = TextField('Title', [validators.Length(min=4, max=60)]) author = TextField('Author', [validators.Length(min=4, max=25)]) published = BooleanField('Publish') permalink = TextField('Permanent Link', [validators.Length(min=10, max=60)])
class placeableUpgradeForm(Form): name = StringField('Type Name', [validators.Length(min=4, max=20)]) description = TextAreaField('Describe the Intention of this upgrade', [validators.Length(min=4, max=250)]) #Upgrde type selectable upgrade_type = SelectField(u'Upgrade Type', coerce=unicode) del_entity = HiddenField('del_entity')
class QuestionForm(Form): """Form that receives questions from users to the "Answer" tool""" theme = SelectField( _('Theme'), [ validators.Required( message=_(u'You need to choose one of the options above')) ], ) title = TextField( _('Contribution title'), [ validators.Length(min=5, message=_( u'Your title is too short! It needs to have ' u'at least 5 chars')), validators.Length(max=256, message=_( u'Your title is too long! It needs to have ' u'at most 256 chars')) ], ) question = TextField( _('Content'), [ validators.Length( min=5, message=_(u'Your contribution is too short! It needs to have ' u'at least 50 chars')), ], )
class RegistrationForm(Form): full_name = TextField(lazy_gettext('School name'), [validators.Required(), validators.Length(min=4)] + forms.SCHOOL_FULL_NAME_VALIDATORS, description=lazy_gettext('School name.')) short_name = TextField( lazy_gettext('Short name'), [validators.Required()] + forms.SCHOOL_SHORT_NAME_VALIDATORS, description=lazy_gettext( 'Short name (lower case, all letters, dots and numbers).')) url = TextField(lazy_gettext('School URL'), [ validators.Length(min=6, max=200), validators.URL(), validators.Required() ], description=lazy_gettext('Address of your school.')) user_full_name = TextField( lazy_gettext('User name'), [validators.Required(), validators.Length(min=4)] + forms.USER_FULL_NAME_VALIDATORS, description=lazy_gettext('Your name and last name.')) user_login = TextField(lazy_gettext('Login'), [validators.Required()] + forms.USER_LOGIN_DEFAULT_VALIDATORS, description=lazy_gettext( 'Your new login (you can create more later).')) user_password = PasswordField( lazy_gettext('Password'), [validators.Required()] + forms.USER_PASSWORD_DEFAULT_VALIDATORS, description=lazy_gettext('Your access password.'))
class LoginForm(Form): email = TextField( 'Email', validators=[validators.Required(), validators.Length(min=1)]) password = PasswordField( 'Password', validators=[validators.Required(), validators.Length(max=50)])
class ProfileForm(Form): next = HiddenField() name = TextField(_('Username')) email = TextField(_('email'), [validators.Email()]) website = TextField(_('URL'), [validators.URL()]) location = TextField(_('Location'), [validators.Length(max=100)]) bio = TextAreaField(_('bio'), [validators.Length(max=200)]) submit = SubmitField(_('Save'))
class LoginForm(Form): username = TextField('Username or Email', [validators.Length(min=4, max=255)], filters=[strip_filter]) password = PasswordField('Password', [validators.Length(min=1, max=255)], filters=[strip_filter]) remember_me = BooleanField('Remember me', default=False)
class RegistrationForm(Form): username = TextField('Username', [validators.Length(min=6, max=35)]) email = TextField('Email Address', [validators.Length(min=6, max=35)]) password = PasswordField('Password', [ validators.Length(min=6, max=35), validators.Required(), validators.EqualTo('confirm', message='Passwords must match') ]) confirm = PasswordField('Repeat Password')
class RegistrationForm(Form): name = fields.TextField(u'First & Last name', [validators.Length(min=5)], description=u'John Doe') email = fields.TextField(u'Email', [validators.Email()], description=u'*****@*****.**') position = fields.TextField(u'Job Position', [validators.Length(min=5)], description=u'Senior Software Developer') company = fields.TextField(u'Company', [validators.Length(min=2)], description=u'Top 10 leader')
class LoginForm(Form): username = TextField( 'Username', validators=[validators.Required(), validators.Length(min=3, max=8)]) password = PasswordField( 'Password', validators=[validators.Required(), validators.Length(max=50)])
class RegistrationForm(Form): username = TextField('Username', [validators.Length(min=4, max=25)]) email = TextField('Email Address', [validators.Length(min=6, max=35)]) zipcode = TextField('Zipcode', [validators.Length(min=5, max=35)]) password = PasswordField('New Password', [ validators.Required(), validators.EqualTo('confirm', message='Passwords must match') ]) confirm = PasswordField('Repeat Password') accept_tos = BooleanField('I accept the TOS', [validators.Required()])
class BookmarkForm(Form): title = TextField('title', [validators.Length(min=0, max=255)], filters=[strip_filter]) url = TextField('url', [ validators.Length(min=4, max=512), validators.URL(require_tld=False, message='Not a valid URL') ], filters=[strip_filter]) tags = TextField('tags', [validators.Length(min=0, max=255)], filters=[strip_filter])
class RegisterForm(Form): w = TextField('Username', [validators.Length(min=3, max=25), existscheck]) n = TextField('Email Address', [ validators.Length(min=3, max=35), validators.Email(message='Must be a valid email address') ]) s = PasswordField('Password', [ validators.Required(), validators.EqualTo('c', message='Passwords must match') ]) c = PasswordField('Repeat Password')
class RegisterForm(Form): email = TextField( 'Email', validators=[validators.Required(), validators.Length(min=1)]) password = PasswordField( 'Password', validators=[validators.Required(), validators.Length(max=50)]) name = TextField( 'Name', validators=[validators.Required(), validators.Length(min=3)])
class RegistrationForm(Form): username = TextField(u'Nazwa użytkownika', [validators.Length(min=4, max=25)], id="username") email = TextField(u'Adres email', [validators.Length(min=6, max=35)], id="email") password = PasswordField(u'Nowe hasło', [ validators.Required(), validators.EqualTo('confirm', message='Hasła muszą być takie same') ], id="password") confirm = PasswordField(u'Powtórz hasło', id="confirm")
class UpdateProfileForm(Form): updatedProfileImage = FileField( "Photo Upload", validators=[ file_allowed( images, message= "The file you selected does not appear to be an image, please try again or contact support" ) ]) location = TextField() slogan = TextField(validators=[ validators.Length( min=0, max=140, message= "Please keep your slogan short, 140 characters or less, please.") ]) description = TextField(validators=[ validators.Length( min=0, max=400, message="Please limit your description to 400 characters") ]) def __init__(self, *args, **kwargs): Form.__init__(self, *args, **kwargs) def hasImage(self): return self.updatedProfileImage.data != None def validate(self): rv = Form.validate(self) self.rv = rv if not rv: return False #TODO: this code is repeated, inheritance seemed to break the cleaner version though if len(self.slogan.data) and self.slogan.data != current_user.slogan: current_user.slogan = self.slogan.data flash("Your slogan has been updated", "message") if len(self.description.data ) and self.description.data != current_user.description: current_user.description = self.description.data flash("Your description has been updated", "message") if len(self.location.data ) and self.location.data != current_user.location: current_user.location = self.location.data flash("Your location has been updated", "message") db.session.commit() return True
class ContentCreate_Form(Form): next = HiddenField() tags_csv = HiddenField() title = TextField( "Title", validators=[validators.required(), validators.Length(max=128)]) teaser = TextAreaField( "Teaser", validators=[validators.required(), validators.Length(max=200)]) content = TextAreaField("Body", validators=[validators.Required()]) #recaptcha = RecaptchaField() submit = SubmitField("Submit")
class UserRegisterForm(Form): username = TextField('username', [validators.Length(min=4, max=32)], filters=[strip_filter]) email = TextField('email', [ validators.Length(min=4, max=320), validators.Email(message='Not a valid email address') ], filters=[strip_filter]) password = PasswordField('password', [ validators.Length(min=6, max=64), validators.EqualTo('confirm', message='Passwords must match') ], filters=[strip_filter]) confirm = PasswordField('confirm', filters=[strip_filter])
class ResetForm(Form): password = PasswordField('Password', validators=[ validators.Required(), validators.Length(min=8, max=50), validators.CrackLib() ]) pw_confirm = PasswordField('Confirm Password', validators=[ validators.Required(), validators.Length(min=8, max=50), validators.EqualTo( 'password', message='Passwords do not match.') ])
class SpaceUrlForm(Form): url = TextField( lazy_gettext('Space URL'), [validators.Length(min=6, max=200), validators.URL()], description=lazy_gettext("Drop here the URL of the Space."), default="http://graasp.epfl.ch/#item=space_1234")
class ResetPasswordForm(Form): password = f.PasswordField('New 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')
class ChangePassForm(Form): old_password = PasswordField('Password', [validators.Required()]) password = PasswordField('Password', [ validators.Length(min=6, max=35), validators.Required(), validators.EqualTo('confirm', message='Passwords must match') ]) confirm = PasswordField('Repeat Password')
class LoginForm(Form): username = TextField(u'Nazwa użytkownika', [validators.Length(min=4, max=25)], id="username") password = PasswordField(u'Hasło', [ validators.Required(), ], id="password")
class UserForm(Form, wtforms.ext.i18n.form.Form): username = TextField(lazy_gettext('login.placeholder.username'), [ validators.Length(min=2, max=25), validators.Regexp('^\w+$', message=lazy_gettext('signup.error.alphanum')) ]) password = PasswordField(lazy_gettext('login.placeholder.password'), [validators.Required()])
class MarkForm(Form): referrer = HiddenField([validators.URL(require_tld=False)]) title = TextField('Title', [validators.Length(min=0, max=255)], filters=[strip_filter]) url = TextField('URL', [validators.Length(min=4, max=512), validators.URL(require_tld=False, message='Not a valid URL')], filters=[strip_filter]) type = RadioField('Type', coerce=unicode, choices=[('bookmark', 'Bookmark'), ('feed', 'Feed')], default='bookmark') tags = TextField('Tags', [validators.Length(min=0, max=255)], filters=[strip_filter])
class SignupForm(Form): username = f.TextField('Username', [ v.Length(min=3, max=128), v.Regexp(r'^[^@:]*$', message="Username shouldn't contain '@' or ':'") ]) 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 NewPassOnlyForm(Form): new_pass = PasswordField( 'Password', validators=[ validators.Length( min=8, max=50, message='Password length must be between 8 and 50'), validators.CrackLib() ])
class AddUserForm(Form): user = TextField( 'user', validators=[validators.Required(), validators.Length(min=3, max=64)]) email = TextField('email', validators=[validators.Required(), validators.Email()]) password = PasswordField('password', validators=[ validators.Required(), validators.Length(min=3, max=64), validators.EqualTo( 'confirm', 'Both passwords must be equal.') ]) confirm = PasswordField('confirm') roles = MultiCheckboxField('roles', validators=[validators.Required()], coerce=int)
class EditUserForm(Form): id = HiddenInteger('id') user = TextField( 'user', validators=[validators.Required(), validators.Length(min=3, max=64)]) email = TextField('email', validators=[validators.Required(), validators.Email()]) roles = MultiCheckboxField('roles', validators=[validators.Required()], coerce=int)
class RegistrationForm(Form): email = fields.TextField('Email Address', validators=[Required(), Email(), Regexp('[^@]+@[^@]+[fsu]+\.[edu]+')]) consent = fields.BooleanField(validators=[Required()]) password = fields.PasswordField('New Password', [ validators.Required(), validators.Length(min=8, max=20), validators.EqualTo('confirm', message='Passwords must match') ]) confirm = fields.PasswordField(validators=[Required()]) def validate_email(self, field): if db.session.query(User).filter_by(email=self.email.data).count() > 0: raise validators.ValidationError('Duplicate email')