File: //home/arjun/projects/buyercall_new/buyercall/buyercall/blueprints/leads/forms.py
import logging
from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField, SelectField, HiddenField
from wtforms.validators import Length, Optional, DataRequired
from flask_babel import lazy_gettext as _
from buyercall.blueprints.leads.models import Lead
from buyercall.lib.util_wtforms import choices_from_dict
class SearchForm(FlaskForm):
q = StringField(_('Search terms'), [Optional(), Length(1, 128)])
# This field gets used through the lead_edit function to allow notes for leads
class LeadForm(FlaskForm):
firstname = StringField(_('First Name'), [DataRequired()])
lastname = StringField(_('Last Name'), [DataRequired()])
notes = TextAreaField(_('Add some notes here'), [Optional(), Length(1, 8192)])
progress_status = SelectField(_('Progress Status'), [DataRequired()])
agent_assigned_id = SelectField(_('Assigned Agent'), coerce=int)
edited_notes_str = HiddenField()
# This field gets used through the lead_edit function to allow notes for leads
class LeadNoteForm(FlaskForm):
notes = TextAreaField(_('Add some notes here'), [Optional(), Length(1, 8192)])
edited_notes_str = HiddenField()