Eva611
Eva611

Reputation: 6194

DJANGO : Inlineformset specifying fields / exclude

can i simply do this by

BusinessFormSet = inlineformset_factory(Address, Person, exclude = 'middlen')

what if not, please let me know how i should go about specifying which fields i want to render?

Upvotes: 1

Views: 317

Answers (1)

diegueus9
diegueus9

Reputation: 31532

Yes, you can:

https://docs.djangoproject.com/en/1.3/topics/forms/modelforms/#controlling-which-fields-are-used-with-fields-and-exclude

But:

BusinessFormSet = inlineformset_factory(Address, Person, exclude = ['middlen'])

exclude must be a iterable object like a list

Upvotes: 2

Related Questions