=== modified file 'django/contrib/admin/options.py'
|
|
|
664 | 664 | self.admin_site = admin_site |
665 | 665 | self.parent_model = parent_model |
666 | 666 | self.opts = self.model._meta |
| 667 | self.formset_class = forms.inline_formset(parent_model, self.model, fk_name=self.fk_name, formfield_callback=self.formfield_for_dbfield, extra=self.extra) |
667 | 668 | super(InlineModelAdmin, self).__init__() |
668 | 669 | |
669 | 670 | def formset_add(self, request): |
… |
… |
|
681 | 682 | return self.fieldsets |
682 | 683 | if self.fields: |
683 | 684 | return [(None, {'fields': self.fields})] |
684 | | fields = [f for f in self.formset_class(request).form_class.base_fields.keys()] |
| 685 | fields = [f for f in self.formset_class.form_class.base_fields.keys()] |
685 | 686 | return [(None, {'fields': fields})] |
686 | 687 | |
687 | 688 | class StackedInline(InlineModelAdmin): |