开发者

DJANGO : Inlineformset specifying fields / exclude

开发者 https://www.devze.com 2023-03-14 12:23 出处:网络
can i simply do this by BusinessFormSet = inlineformset_factory(Address, Person, exclude = \'middlen\')

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 开发者_JAVA技巧render?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消