只有Formset标题?

时间:2012-04-10 09:24:10

标签: django django-forms django-templates

我想只提供表单集的标题:

    CaracFormSet = formset_factory(CaracForm, extra=0)
    CaracFormSet = CaracFormSet(prefix='carac',initial=initial)

我只想要标题怎么做?

    print CaracFormSet. what ?

这是我的formset的标题:

    <input type="hidden" name="carac-TOTAL_FORMS" value="2" id="id_carac-TOTAL_FORMS
    " /><input type="hidden" name="carac-INITIAL_FORMS" value="2" id="id_carac-INITI
    AL_FORMS" /><input type="hidden" name="carac-MAX_NUM_FORMS" id="id_carac-MAX_NUM
    _FORMS" />

此致 比西耶尔

1 个答案:

答案 0 :(得分:2)

您需要management_form

print CaracFormSet.management_form