开发者

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 开发者_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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜