django-bootstrap5
django-bootstrap5 copied to clipboard
Add ability to specify the form for radio input
Form inputs may be associated with different forms. It allows creating "forms within forms". Read a definition on HTML spec. One can specify the form the input will be associated with like this:
sex = forms.ChoiceField(
widget=forms.RadioSelect(attrs={"form": "order-create-form"}),
choices=Order.SEX_CHOICES,
label=_("Sex"),
)