class ChangePhoneNumberForm(Form): old_phone_number = PhoneNumberField('Old phone number', validators=[InputRequired()]) new_phone_number = PhoneNumberField( 'New phone number', validators=[ InputRequired(), EqualTo('new_phone_number2', 'Phone numbers must match.') ]) new_phone_number2 = PhoneNumberField( 'Confirm new phone number', validators=[InputRequired()]) submit = SubmitField('Update phone number')
class TargetForm(FlaskForm): order = IntegerField(_('Order'),) title = TextField(_('Title'), [Optional()]) name = TextField(_('Name'), [Required()]) number = PhoneNumberField(_('Phone Number'), [Required()]) location = TextField(_('Location'), [Optional()]) key = TextField(_('Unique Key'), [Optional()])
class SignUp(FlaskForm): event = StringField('Event', validators=[DataRequired()], render_kw={"placeholder": "Event"}) first_name = StringField('First Name', validators=[DataRequired()], render_kw={"placeholder": "First Name"}) last_name = StringField('Last Name', validators=[DataRequired()], render_kw={"placeholder": "Last Name"}) phone_number = PhoneNumberField(validators=[DataRequired()], render_kw={"placeholder": "Phone Number"}) email = StringField('Email', validators=[Email()], render_kw={"placeholder": "Email"}) address = StringField('Address', validators=[DataRequired()], render_kw={"placeholder": "Address"}) city = StringField('City', validators=[DataRequired()], render_kw={"placeholder": "City"}) zip_code = StringField('Zip Code', validators=[Length(min=5)], render_kw={"placeholder": "Zip"}) receive_emails = BooleanField('Recieve Emails?') receive_texts = BooleanField('Recieve Texts?') submit = SubmitField('Sign Up!')
class UserForm(FlaskForm): next = HiddenField() email = EmailField(_('Email'), [Required(), Email()]) name = TextField( _('Username'), [Required(), Length(USERNAME_LEN_MIN, USERNAME_LEN_MAX)]) phone = PhoneNumberField(_('Phone Number'), description="Optional") submit = SubmitField(_('Save'))
class ExtendRegisterForm(RegisterForm): first_name = StringField('Nombre', validators=[DataRequired()]) last_name = StringField('Apellido', validators=[DataRequired()]) phone_number = PhoneNumberField('Telefono', validators=[DataRequired()]) country = CountryField('País', validators=[DataRequired()]) aceptar = BooleanField('', validators=[DataRequired()]) gender = SelectField('Genero', choices=genders, validators=[DataRequired()])
class ReservationForm(FlaskForm): ''' This is the form that displays fields to make a reservation ''' name = StringField('Name', [validators.Length(min=2, max=25)]) num = IntegerField('Guests', [validators.NumberRange(min=1, max=None)]) # phone = StringField('Phone Number', [validators.Length(min=10, max=10)]) phone = PhoneNumberField('Phone Number', [validators.DataRequired()]) length = IntegerField('Reservation Length(Minutes)', [validators.NumberRange(min=30, max=None)]) start = DateTimeField('Time and Date')
class CreateUserForm(FlaskForm): next = HiddenField() email = EmailField(_('Email'), [Required(), Email()]) name = TextField( _('Username'), [Required(), Length(USERNAME_LEN_MIN, USERNAME_LEN_MAX)]) phone = PhoneNumberField(_('Phone Number'), description="Optional") password = PasswordField( _('Password'), [Required(), Length(PASSWORD_LEN_MIN, PASSWORD_LEN_MAX)]) password_confirm = PasswordField( u'Password Confirm', [EqualTo('password', message="Passwords don't match")]) submit = SubmitField(_('Save'))
class ArtistForm(Form): name = StringField('name', validators=[DataRequired()]) city = StringField('city', validators=[DataRequired()]) state = SelectField('state', validators=[DataRequired()], choices=state_choices) phone = PhoneNumberField('phone') image_link = StringField('image_link') genres = SelectMultipleField('genres', validators=[DataRequired()], choices=genre_choices) facebook_link = StringField('facebook_link', validators=[URL()]) seeking_venue = BooleanField('Seeking Venue?') seeking_description = StringField('Venue Description?')
class UserUpdateForm(Form): location = StringField('location', [validators.Length(max=120)]) phone = PhoneNumberField('phone', country_code='GB') name = StringField('name', [validators.Length(max=255)]) def validate(self): res = super(UserUpdateForm, self).validate() if not res: return False for field in [self.location, self.phone, self.name]: if field.data: return True self.errors['error'] = ['At least one field must be filled to update'] return False
class SignIn(FlaskForm): event = StringField('Event', validators=[DataRequired()], render_kw={"placeholder": "Event"}) first_name = StringField('First Name', validators=[DataRequired()], render_kw={"placeholder": "First Name"}) last_name = StringField('Last Name', validators=[DataRequired()], render_kw={"placeholder": "Last Name"}) phone_number = PhoneNumberField(validators=[DataRequired()], render_kw={"placeholder": "Phone Number"}) email = StringField('Email', validators=[Email()], render_kw={"placeholder": "Email"}) submit = SubmitField('Sign In!')
class VenueForm(Form): name = StringField('name', validators=[DataRequired()]) city = StringField('city', validators=[DataRequired()]) state = SelectField('state', validators=[DataRequired()], choices=state_choices) address = StringField('address', validators=[DataRequired()]) phone = PhoneNumberField('phone') image_link = StringField('image_link') genres = SelectMultipleField('genres', validators=[DataRequired()], choices=genre_choices) facebook_link = StringField('facebook_link', validators=[URL()]) website = StringField('website', validators=[URL()]) seeking_talent = BooleanField('Seeking Talent?') seeking_description = StringField('Talent Description?')
class BlocklistForm(FlaskForm): phone_number = PhoneNumberField(_('Phone Number'), [Optional()]) phone_hash = StringField(_('Phone Hash'), validators=[Optional()]) ip_address = StringField(_('IP Address'), validators=[Optional(), IPAddress()]) expires = TimeField(_('Expiration'), [Optional()]) submit = SubmitField(_('Next')) def validate(self): if not super(BlocklistForm, self).validate(): return False if not self.phone_number.data and not self.phone_hash.data and not self.ip_address.data: msg = 'At least one of Phone Number, Phone hash, or IP Address must be set' self.phone_number.errors.append(msg) self.phone_hash.errors.append(msg) self.ip_address.errors.append(msg) return False return True
class RegistrationForm(FlaskForm): email = StringField('Введите почту', validators=[DataRequired(), Email()]) first_name = StringField('Введите имя', validators=[DataRequired()]) second_name = StringField('Введите фамилию', validators=[DataRequired()]) phone = PhoneNumberField('Введите номер телефона', validators=[DataRequired()]) password = PasswordField('Введите пароль для входа', validators=[DataRequired()]) pass_submit = PasswordField( 'Повторите пароль', validators=[DataRequired(), EqualTo('password')]) submit = SubmitField('Зарегистрироваться') def validate_username(self, username): user = User.query.filter_by(username=username.data).first() if user is not None: raise ValidationError('Выберите другое имя')
class ProfeForm(Default): subjects = QuerySelectField( 'Asignaturas', query_factory=subject_query, allow_blank=True ) full_name = StringField( 'Nombre del Profesor', validators=[DataRequired(), Length(max=80)] ) email = EmailField( 'Email', validators=[Length(max=80)] ) phone = PhoneNumberField( 'Telefono' )
class RegistrationForm(FlaskForm): ''' This is the form that displays fields to make a reservation ''' email = StringField('Email', [validators.DataRequired(), validators.Email()]) name = StringField('Name', [validators.DataRequired()]) phone = PhoneNumberField('Phone Number', [validators.DataRequired()]) address = StringField( 'Address', [validators.Length(min=2, max=250), validators.DataRequired()]) password = PasswordField( 'Password', [validators.DataRequired(), validators.Length(min=4, max=50)]) role = SelectField('Role', [validators.DataRequired()], choices=[('customer', 'Customer'), ('manager', 'Manager'), ('admin', 'Administrator')])
class PhoneNumberForm(Form): phone = PhoneNumberField('Phone number', validators=[DataRequired()])
class TextForm(FlaskForm): phone_number = PhoneNumberField(validators=[DataRequired()], render_kw={"placeholder": "Phone Number"}) submit = SubmitField('Send Text')
class TestForm(Form): phone_number = PhoneNumberField(**kwargs)
class MyForm(ModelForm): phone = PhoneNumberField(validators=[Unique(User.phone)], region='ES')