def _construct_form(self, i, **kwargs):
    form = super(SponsorBenefitsInlineFormSet, self)._construct_form(i, **kwargs)
    fields = form.instance.data_fields()
    form.fields = dict(((k, v) for (k, v) in form.fields.items() if (k in (fields + ['id']))))
    for field in fields:
        form.fields[field].label = ''
        if ((form.instance.benefit.type in ['text', 'richtext']) and form.instance.max_words):
            form.fields[field].help_text = (u'maximum %s words' % form.instance.max_words)
        if (field == 'upload'):
            form.fields[field].widget = AdminFileWidget()
    return form
def _construct_form(self, i, **kwargs):
    form = super(SponsorBenefitsInlineFormSet, self)._construct_form(i, **kwargs)
    fields = form.instance.data_fields()
    form.fields = dict(((k, v) for (k, v) in form.fields.items() if (k in (fields + ['id']))))
    for field in fields:
        form.fields[field].label = 
        if ((form.instance.benefit.type in ['text', 'richtext']) and form.instance.max_words):
            form.fields[field].help_text = (u'maximum %s words' % form.instance.max_words)
        if (field == 'upload'):
            form.fields[field].widget = AdminFileWidget()
    return form