HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
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()