nukl
nukl

Reputation: 10511

Access form fields in InlineFormSets

If you override forms.ModelForms you easily can access it form fields, like:

class CustomModelForm(forms.ModelForm):
    def __init__(self, *args, **kwargs):
        super(CustomModelForm, self).__init__(*args, **kwargs)
        self.fields['field_name']

How to do the same thing with Formsets, like forms.models.BaseInlineFormSet?

Upvotes: 1

Views: 65

Answers (1)

Daniel Roseman
Daniel Roseman

Reputation: 599480

Create a custom form and pass that as the form argument to inlineformset_factory.

Upvotes: 2

Related Questions