# Path: hashview/models.py
# class Customers(db.Model):
#     id = db.Column(db.Integer, primary_key=True)
#     name = db.Column(db.String(40), nullable=False)


from flask_wtf import FlaskForm
from wtforms import StringField
from wtforms.validators import DataRequired, ValidationError
from hashview.models import Customers

class CustomersForm(FlaskForm):
    name = StringField('Customer Name', validators=[DataRequired()])

    def validate_name(self, name):
        customer = Customers.query.filter_by(name = name.data).first()

# Path: hashview/models.py
# class Customers(db.Model):
#     id = db.Column(db.Integer, primary_key=True)
#     name = db.Column(db.String(40), nullable=False)


# Path: hashview/customers/forms.py
from flask_wtf import FlaskForm
from wtforms import StringField
from wtforms.validators import DataRequired, ValidationError
from hashview.models import Customers


class CustomersForm(FlaskForm):
    name = StringField('Customer Name', validators=[DataRequired()])

    def validate_name(self, name):
        customer = Customers.query.filter_by(name = name.data).first()

        if customer: