# Path: bluespot/guest/const.py
# SESSION_INIT            = 1
# SESSION_AUTHORIZED      = 3
# SESSION_EXPIRED         = 4
# SESSION_BAN             = 5
# GUESTRACK_INIT          = 1 #Guesttrack creation
# GUESTRACK_SESSION       = 2 #guesttrack is assigned a session
# GUESTRACK_NO_AUTH       = 3 #guest track of no_auth site
# GUESTRACK_TEMP_AUTH     = 4 #guesttrack authorization started
# GUESTRACK_NEW_AUTH      = 5 #newly authorized guest track
# GUESTRACK_SOCIAL_PREAUTH= 6 #guesttrack devices previously authorized
# DEVICE_INIT             = 1
# DEVICE_AUTH             = 2
# DEVICE_SMS_AUTH         = 3
# DEVICE_BAN              = 4
# GUEST_INIT              = 1
# GUEST_AUTHORIZED        = 2
# GUEST_BANNED            = 3


from flask.ext.wtf import Form
from wtforms import TextField, HiddenField
from wtforms.validators import Required,DataRequired,Email
from .const import form_fields_dict



class FacebookTrackForm(Form):

    authlike = HiddenField("Auth Like")
    authpost = HiddenField("Auth Post")

def generate_emailform(form_fields):
    class F(Form):
        pass
    for key in form_fields:
        if key in ['firstname','lastname','email','phonenumber']:
            if  key == 'email':
                setattr(F, key, TextField(form_fields_dict[key],validators =[DataRequired(),Email()]))
            else:

# Path: bluespot/guest/const.py
# SESSION_INIT            = 1
# SESSION_AUTHORIZED      = 3
# SESSION_EXPIRED         = 4
# SESSION_BAN             = 5
# GUESTRACK_INIT          = 1 #Guesttrack creation
# GUESTRACK_SESSION       = 2 #guesttrack is assigned a session
# GUESTRACK_NO_AUTH       = 3 #guest track of no_auth site
# GUESTRACK_TEMP_AUTH     = 4 #guesttrack authorization started
# GUESTRACK_NEW_AUTH      = 5 #newly authorized guest track
# GUESTRACK_SOCIAL_PREAUTH= 6 #guesttrack devices previously authorized
# DEVICE_INIT             = 1
# DEVICE_AUTH             = 2
# DEVICE_SMS_AUTH         = 3
# DEVICE_BAN              = 4
# GUEST_INIT              = 1
# GUEST_AUTHORIZED        = 2
# GUEST_BANNED            = 3


# Path: bluespot/guest/forms.py
from flask.ext.wtf import Form
from wtforms import TextField, HiddenField
from wtforms.validators import Required,DataRequired,Email
from .const import form_fields_dict



class FacebookTrackForm(Form):

    authlike = HiddenField("Auth Like")
    authpost = HiddenField("Auth Post")

def generate_emailform(form_fields):
    class F(Form):
        pass
    for key in form_fields:
        if key in ['firstname','lastname','email','phonenumber']:
            if  key == 'email':
                setattr(F, key, TextField(form_fields_dict[key],validators =[DataRequired(),Email()]))
            else:

                setattr(F, key, TextField(form_fields_dict[key],validators = [Required()]))        
