Ticket #14572: generic-fix.diff
File generic-fix.diff, 1.2 KB (added by , 14 years ago) |
---|
-
contrib/contenttypes/generic.py
342 342 fields=None, exclude=None, 343 343 extra=3, can_order=False, can_delete=True, 344 344 max_num=None, 345 formfield_callback= lambda f: f.formfield()):345 formfield_callback=None): 346 346 """ 347 347 Returns an ``GenericInlineFormSet`` for the given kwargs. 348 348 … … 376 376 ct_fk_field = "object_id" 377 377 formset = BaseGenericInlineFormSet 378 378 379 def get_formset(self, request, obj=None ):379 def get_formset(self, request, obj=None, **kwargs): 380 380 if self.declared_fieldsets: 381 381 fields = flatten_fieldsets(self.declared_fieldsets) 382 382 else: … … 400 400 "max_num": self.max_num, 401 401 "exclude": exclude 402 402 } 403 defaults.update(kwargs) 403 404 return generic_inlineformset_factory(self.model, **defaults) 404 405 405 406 class GenericStackedInline(GenericInlineModelAdmin):