Luiz C.
Luiz C.

Reputation: 776

Group form fields in django?

Is there a way in Django to group some fields from a ModelForm? For example, if there's a model with fields like: age, gender, dob, q1, q2, q3 and a form is created based in such Model, can I group the fields like: info_fields = (age, gender, dob) and response_fields = (q1, q2, q3). This would be helpful to display all fields in a more organized way on a template.

Thanks in advance

Upvotes: 1

Views: 8409

Answers (1)

buckley
buckley

Reputation: 2110

See this post, I believe your hinting at using fieldsets in a ModelForm. Django and fieldsets on ModelForm

Upvotes: 1

Related Questions