Carl Brubaker
Carl Brubaker

Reputation: 1655

Django custom form field layout without manually redoing the whole form

I like Django form render(‘form’: form) and template {{ form }}, but it doesn’t allow you to arrange fields. I was just wondering if there was an easier way to do it, without rendering the whole form manually.

What Django does:

First Name
Middle Name
Last Name

What I want to do:

First Name                 Middle Name
Last Name

What makes Django {{ form }} so great is that it puts field labels and help text and all that jazz in the right places. Where as manually, you have to put all that in. If there isn’t an easier way, I’m ok with that, but I thought I would at least ask.

Upvotes: 1

Views: 354

Answers (1)

Ralf
Ralf

Reputation: 16515

You could try to render individual fields of the form, like this part of the docs shows.

Upvotes: 1

Related Questions