python - Django form field required based on field from another form -
i have form in set form fields 'required' based on value form in same view
example
class forma(forms.form): field_a = forms.charfield() field_b = forms.charfield() class formb(forms.form): field_x = forms.choicefield(choices = [('a', 'a'), ('b', 'b')])
i set fields in forma required during validation of form, based on value of fields_x in formb. there clean way in django ?
Comments
Post a Comment