The project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
622 B

from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from dal.autocomplete import ModelSelect2Multiple
from .models import Job
class JobForm(forms.ModelForm):
class Meta:
model = Job
fields = ('title', 'description', 'tags')
widgets = {
'tags': ModelSelect2Multiple(url='jobs:tag-autocomplete')
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.form_method = 'post'
self.helper.add_input(Submit('submit', 'Post Job'))