Ticket #5383: formset-class-not-set.diff

File formset-class-not-set.diff, 958 bytes (added by Petr Marhoun <petr.marhoun@…>, 17 years ago)
  • django/contrib/admin/options.py

    === modified file 'django/contrib/admin/options.py'
     
    664664        self.admin_site = admin_site
    665665        self.parent_model = parent_model
    666666        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)
    667668        super(InlineModelAdmin, self).__init__()
    668669
    669670    def formset_add(self, request):
     
    681682            return self.fieldsets
    682683        if self.fields:
    683684            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()]
    685686        return [(None, {'fields': fields})]
    686687
    687688class StackedInline(InlineModelAdmin):
Back to Top