Source code for careers.forms
__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)"
__license__ = "AGPL v3"
from django import forms
from scipost.fields import ReCaptchaField
from .models import JobOpening, JobApplication
[docs]class JobOpeningForm(forms.ModelForm):
[docs] class Meta:
model = JobOpening
fields = [
"slug",
"announced",
"title",
"short_description",
"description",
"application_deadline",
"status",
]
[docs]class JobApplicationForm(forms.ModelForm):
captcha = ReCaptchaField(label="* Please verify to continue:")
[docs] class Meta:
model = JobApplication
fields = [
"status",
"jobopening",
"date_received",
"title",
"first_name",
"last_name",
"email",
"motivation",
"cv",
]
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields["status"].widget = forms.HiddenInput()
self.fields["date_received"].widget = forms.HiddenInput()
self.fields["jobopening"].widget = forms.HiddenInput()
self.fields["cv"].label = "CV"