text: from datetime import datetime
  from flask_wtf import Form
  from wtforms import StringField, SelectField, SelectMultipleField, DateTimeField, BooleanField
  from wtforms.validators import DataRequired, AnyOf, URL, Length, Regexp, Optional
  
  
  facebook_pattern = "(?:https?:\/\/)?(?:www\.)?(mbasic.facebook|m\.facebook|facebook|fb)\.(com|me)\/(?:(?:\w\.)*#!\/)?(?:pages\/)?(?:[\w\-\.]*\/)*([\w\-\.]*)"
  is_number_pattern = "[0-9]+"
  phone_pattern='^[0-9]{3}-[0-9]{3}-[0-9]{4}$'
  
  class ShowForm(Form):
      artist_id = StringField(
          'artist_id', validators=[Optional(True), Regexp(regex=is_number_pattern, message='id must be a number')]
      )
      venue_id = StringField(
          'venue_id', validators=[Optional(True), Regexp(regex=is_number_pattern, message='id must be a number')]
      )
      start_time = DateTimeField(
          'start_time',
          validators=[DataRequired()],
          default= datetime.today()
      )
  
  class VenueForm(Form):
      name = StringField(
          'name', validators=[DataRequired()]
      )
      city = StringField(
          'city', validators=[DataRequired()]
      )
      state = SelectField(
          'state', validators=[DataRequired()],
          choices=[
              ('AL', 'AL'),
              ('AK', 'AK'),
              ('AZ', 'AZ'),
              ('AR', 'AR'),
              ('CA', 'CA'),
              ('CO', 'CO'),
              ('CT', 'CT'),
              ('DE', 'DE'),
              ('DC', 'DC'),
              ('FL', 'FL'),
              ('GA', 'GA'),
              ('HI', 'HI'),
              ('ID', 'ID'),
              ('IL', 'IL'),
              ('IN', 'IN'),
              ('IA', 'IA'),
              ('KS', 'KS'),
              ('KY', 'KY'),
              ('LA', 'LA'),
              ('ME', 'ME'),
              ('MT', 'MT'),
              ('NE', 'NE'),
              ('NV', 'NV'),
              ('NH', 'NH'),
              ('NJ', 'NJ'),
              ('NM', 'NM'),
              ('NY', 'NY'),
              ('NC', 'NC'),
              ('ND', 'ND'),
              ('OH', 'OH'),
              ('OK', 'OK'),
              ('OR', 'OR'),
              ('MD', 'MD'),
              ('MA', 'MA'),
              ('MI', 'MI'),
              ('MN', 'MN'),
              ('MS', 'MS'),
              ('MO', 'MO'),
              ('PA', 'PA'),
              ('RI', 'RI'),
              ('SC', 'SC'),
              ('SD', 'SD'),
              ('TN', 'TN'),
              ('TX', 'TX'),
              ('UT', 'UT'),
              ('VT', 'VT'),
              ('VA', 'VA'),
              ('WA', 'WA'),
              ('WV', 'WV'),
              ('WI', 'WI'),
              ('WY', 'WY'),
          ]
      )
      address = StringField(
          'address', validators=[DataRequired()]
      )
      phone = StringField(
          'phone', validators=[Length(min=12, max=12), DataRequired(), Regexp(regex=phone_pattern, message="please enter a number in the format XXX-XXX-XXXX")]
      )
      image_link = StringField(
          'image_link', validators=[URL()]
      )
      genres = SelectMultipleField(
          'genres', validators=[DataRequired()],
          choices=[
              ('Alternative', 'Alternative'),
              ('Blues', 'Blues'),
              ('Classical', 'Classical'),
              ('Country', 'Country'),
              ('Electronic', 'Electronic'),
              ('Folk', 'Folk'),
              ('Funk', 'Funk'),
              ('Hip-Hop', 'Hip-Hop'),
              ('Heavy Metal', 'Heavy Metal'),
              ('Instrumental', 'Instrumental'),
              ('Jazz', 'Jazz'),
              ('Musical Theatre', 'Musical Theatre'),
              ('Pop', 'Pop'),
              ('Punk', 'Punk'),
              ('R&B', 'R&B'),
              ('Reggae', 'Reggae'),
              ('Rock n Roll', 'Rock n Roll'),
              ('Soul', 'Soul'),
              ('Other', 'Other'),
          ]
      )
      facebook_link = StringField(
          'facebook_link', validators=[Optional(True), Regexp(regex=facebook_pattern, message='please enter your facebook link in the form https://www.facebook.com/<your-site>')]
      )
      website_link = StringField(
          'website_link', validators=[Optional(True), URL()]
      )
  
      seeking_talent = BooleanField( 'seeking_talent' )
  
      seeking_description = StringField(
          'seeking_description'
      )
  
  class ArtistForm(Form):
      name = StringField(
          'name', validators= [DataRequired()] 
      )
      city = StringField(
          'city', validators=[DataRequired()]
      )
      state = SelectField(
          'state', validators=[DataRequired()],
          choices=[
              ('AL', 'AL'),
              ('AK', 'AK'),
              ('AZ', 'AZ'),
              ('AR', 'AR'),
              ('CA', 'CA'),
              ('CO', 'CO'),
              ('CT', 'CT'),
              ('DE', 'DE'),
              ('DC', 'DC'),
              ('FL', 'FL'),
              ('GA', 'GA'),
              ('HI', 'HI'),
              ('ID', 'ID'),
              ('IL', 'IL'),
              ('IN', 'IN'),
              ('IA', 'IA'),
              ('KS', 'KS'),
              ('KY', 'KY'),
              ('LA', 'LA'),
              ('ME', 'ME'),
              ('MT', 'MT'),
              ('NE', 'NE'),
              ('NV', 'NV'),
              ('NH', 'NH'),
              ('NJ', 'NJ'),
              ('NM', 'NM'),
              ('NY', 'NY'),
              ('NC', 'NC'),
              ('ND', 'ND'),
              ('OH', 'OH'),
              ('OK', 'OK'),
              ('OR', 'OR'),
              ('MD', 'MD'),
              ('MA', 'MA'),
              ('MI', 'MI'),
              ('MN', 'MN'),
              ('MS', 'MS'),
              ('MO', 'MO'),
              ('PA', 'PA'),
              ('RI', 'RI'),
              ('SC', 'SC'),
              ('SD', 'SD'),
              ('TN', 'TN'),
              ('TX', 'TX'),
              ('UT', 'UT'),
              ('VT', 'VT'),
              ('VA', 'VA'),
              ('WA', 'WA'),
              ('WV', 'WV'),
              ('WI', 'WI'),
              ('WY', 'WY'),
          ]
      )
      phone = StringField(
           'phone', validators=[Length(min=12, max=12), DataRequired(), Regexp(regex=phone_pattern, message="please enter a number in the format XXX-XXX-XXXX")]
       )
  
      image_link = StringField(
          'image_link', validators=[URL()],
      )
      genres = SelectMultipleField(
          'genres', validators=[DataRequired()],
          choices=[
              ('Alternative', 'Alternative'),
              ('Blues', 'Blues'),
              ('Classical', 'Classical'),
              ('Country', 'Country'),
              ('Electronic', 'Electronic'),
              ('Folk', 'Folk'),
              ('Funk', 'Funk'),
              ('Hip-Hop', 'Hip-Hop'),
              ('Heavy Metal', 'Heavy Metal'),
              ('Instrumental', 'Instrumental'),
              ('Jazz', 'Jazz'),
              ('Musical Theatre', 'Musical Theatre'),
              ('Pop', 'Pop'),
              ('Punk', 'Punk'),
              ('R&B', 'R&B'),
              ('Reggae', 'Reggae'),
              ('Rock n Roll', 'Rock n Roll'),
              ('Soul', 'Soul'),
              ('Other', 'Other'),
          ]
       )
      facebook_link = StringField(
          'facebook_link', validators=[Optional(True), Regexp(regex=facebook_pattern, message='please enter your facebook link in the form https://www.facebook.com/<your-site>')]
       )
  
      website_link = StringField(
          'website_link', validators = [Optional(True), URL()]
       )
  
      seeking_venue = BooleanField('seeking_venue' )
  
      seeking_description = StringField(
              'seeking_description'
       )
  
  