Ticket #14572: generic-fix.diff

File generic-fix.diff, 1.2 KB (added by Simon Litchfield, 14 years ago)
  • contrib/contenttypes/generic.py

     
    342342                                  fields=None, exclude=None,
    343343                                  extra=3, can_order=False, can_delete=True,
    344344                                  max_num=None,
    345                                   formfield_callback=lambda f: f.formfield()):
     345                                  formfield_callback=None):
    346346    """
    347347    Returns an ``GenericInlineFormSet`` for the given kwargs.
    348348
     
    376376    ct_fk_field = "object_id"
    377377    formset = BaseGenericInlineFormSet
    378378
    379     def get_formset(self, request, obj=None):
     379    def get_formset(self, request, obj=None, **kwargs):
    380380        if self.declared_fieldsets:
    381381            fields = flatten_fieldsets(self.declared_fieldsets)
    382382        else:
     
    400400            "max_num": self.max_num,
    401401            "exclude": exclude
    402402        }
     403        defaults.update(kwargs)
    403404        return generic_inlineformset_factory(self.model, **defaults)
    404405
    405406class GenericStackedInline(GenericInlineModelAdmin):
Back to Top