I have a modelChoiceField field1
, when I Choose one of its choices, another modelChoiceField field2
is updated with data.
My problem is, this data can be a model1
type data or model2
type data.
and since I have this :
field2=forms.ModelChoiceField(queryset=model1.objects)
the field2
can't be validated if it receives model2
, it's only valid if it receives model1
.
Any help please to make my field valid in both cases ? Thank You for your help