Spaces:
Paused
Paused
| """ | |
| 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 |