You can update the structure of the form before creating an instance of the form, for example:
class SkillForm(ModelForm): class Meta: model = Skills fields = ( 'person', 'skill')
In your opinion:
SkillForm.base_fields['skill'] = forms.ModelChoiceField(queryset= ...) form = SkillForm()
You can override it anytime you want in your view, and you need to do this before creating an instance of the form with
form = SkillForm()
source share