File size: 1,183 Bytes
504df0f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""
WTForms for the Codingo application.
"""

from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileAllowed, FileRequired
from wtforms import StringField, TextAreaField, SubmitField, HiddenField, SelectField
from wtforms.validators import DataRequired, Email, Length


class JobApplicationForm(FlaskForm):
    """Form for submitting a job application."""
    name = StringField('Full Name', validators=[
        DataRequired(),
        Length(min=2, max=100, message="Name must be between 2 and 100 characters.")
    ])

    email = StringField('Email', validators=[
        DataRequired(),
        Email(message="Please enter a valid email address.")
    ])

    resume = FileField('Upload Resume', validators=[
        FileRequired(message="Please upload your resume."),
        FileAllowed(['pdf', 'docx'], 'Only PDF and DOCX files are allowed!')
    ])

    cover_letter = TextAreaField('Cover Letter', validators=[
        DataRequired(),
        Length(min=50, message="Cover letter should be at least 50 characters.")
    ])

    job_id = HiddenField('Job ID')

    submit = SubmitField('Submit Application')

# Add more forms as needed for future features