Right, I don't know whether this is a bug or done on purpose ... It looks like it was done on purpose so I'd be happy to hear the experts on this. I'm using Django 1.3. I hope I got this right.
On line 752 of django.forms.models (development trunk), in the add_fields() method of BaseInlineFormSet it says:
name = self.fk.name
...
form.fields[name] = InlineForeignKeyField(self.instance, **kwargs)
This is *after* all processing of 'fields=' and 'exclude=' kwargs has been done on the form. Consequently, for all inline form sets the foreign key field is always included. It is not possible to 'exclude=' it. Any opinions on why this should be so?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/ZBqnjPrqj80J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment