Question

I'm trying to sectorize a plain forms.Form (not an Admin form, not a ModelForm) into fieldsets (not formsets).

I have the inner class Meta with a fieldsets attribute:

class Meta:
    fieldsets = (
       {'Input Parameters': (
               u'par_cd4Q', 
               u'par_cd4A',
               u'par_cd4QI1', 
               u'par_vPnB1', 
               u'par_vPB1',
               u'par_Tmax',
               u'par_sT',
               u'par_r',
               u'par_xi',
               u'par_muQ')}, 
       {'Simulation Arguments': (
               u'arg_r', 
               u'arg_m')}
    )

But in the template using form.as_p renders just a plain form, without any section.

What am I missing. Is this functionality only available in the admin interface?

Was it helpful?

Solution

You will most likely need to use something like django-crispy-forms for this, I don't believe that functionality is built into the normal form rendering.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top