The ipv6.work 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.

27 lines
675 B

from django import forms
from django.forms import inlineformset_factory
from dal.autocomplete import ModelSelect2Multiple
from .models import Job, Question
class JobForm(forms.ModelForm):
class Meta:
model = Job
fields = ('title', 'description', 'tags')
widgets = {
'tags': ModelSelect2Multiple(url='jobs:tag-autocomplete')
}
class QuestionForm(forms.ModelForm):
class Meta:
model = Question
fields = '__all__'
widgets = {
'name': forms.widgets.TextInput()
}
QuestionFormSet = inlineformset_factory(
Job, Question, form=QuestionForm, can_delete=False, can_order=False)