diff --git a/django/contrib/contenttypes/generic.py b/django/contrib/contenttypes/generic.py
index c294f74..d4023f3 100644
a
|
b
|
class BaseGenericInlineFormSet(BaseModelFormSet):
|
291 | 291 | ct_field_name = "content_type" |
292 | 292 | ct_fk_field_name = "object_id" |
293 | 293 | |
294 | | def __init__(self, data=None, files=None, instance=None, save_as_new=None): |
| 294 | def __init__(self, data=None, files=None, instance=None, |
| 295 | save_as_new=None, prefix=None): |
295 | 296 | opts = self.model._meta |
296 | 297 | self.instance = instance |
297 | 298 | self.rel_name = '-'.join(( |
… |
… |
class BaseGenericInlineFormSet(BaseModelFormSet):
|
300 | 301 | )) |
301 | 302 | super(BaseGenericInlineFormSet, self).__init__( |
302 | 303 | queryset=self.get_queryset(), data=data, files=files, |
303 | | prefix=self.rel_name |
| 304 | prefix=prefix or self.rel_name |
304 | 305 | ) |
305 | 306 | |
306 | 307 | def get_queryset(self): |
diff --git a/tests/modeltests/generic_relations/models.py b/tests/modeltests/generic_relations/models.py
index db5ae47..2c8bbfa 100644
a
|
b
|
__test__ = {'API_TESTS':"""
|
233 | 233 | <p><label for="id_generic_relations-taggeditem-content_type-object_id-1-tag">Tag:</label> <input id="id_generic_relations-taggeditem-content_type-object_id-1-tag" type="text" name="generic_relations-taggeditem-content_type-object_id-1-tag" maxlength="50" /></p> |
234 | 234 | <p><label for="id_generic_relations-taggeditem-content_type-object_id-1-DELETE">Delete:</label> <input type="checkbox" name="generic_relations-taggeditem-content_type-object_id-1-DELETE" id="id_generic_relations-taggeditem-content_type-object_id-1-DELETE" /><input type="hidden" name="generic_relations-taggeditem-content_type-object_id-1-id" id="id_generic_relations-taggeditem-content_type-object_id-1-id" /></p> |
235 | 235 | |
| 236 | >>> formset = GenericFormSet(instance=lion, prefix='x') |
| 237 | >>> for form in formset.forms: |
| 238 | ... print form.as_p() |
| 239 | <p><label for="id_x-0-tag">Tag:</label> <input id="id_x-0-tag" type="text" name="x-0-tag" maxlength="50" /></p> |
| 240 | <p><label for="id_x-0-DELETE">Delete:</label> <input type="checkbox" name="x-0-DELETE" id="id_x-0-DELETE" /><input type="hidden" name="x-0-id" id="id_x-0-id" /></p> |
| 241 | |
236 | 242 | """} |