Inline formset factory ignores 'exclude=' for foreign key field (crosspost)

155 views
Skip to first unread message

gulrtosk

unread,
Mar 3, 2012, 2:02:56 PM3/3/12
to django-d...@googlegroups.com
Hello list,

may I draw your attention to this question I posted in django-users? There have been zero responses so far and I am not sure why.

http://groups.google.com/group/django-users/t/bc7449e9c126056e

Gist: For inline formsets produced with the inlineformset_factory it is not possible to exclude the foreign key field from the forms. Using "exclude=" with a foreign key field has no effect. The reason for this can be found in django.forms.models.BaseInlineFormSet#add_fields(), where the foreign key form field is added after "fields=" and "exclude=" have been processed.

Is this a bug?

I think excluding the foreign key field from the forms of a formset is a valid use of "exclude=".

Cheers, gulrtosk
Reply all
Reply to author
Forward
0 new messages