Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.5.x] Fixed #19477 - Documented generic_inlineformset_factory

Thanks epicserve for the suggestion.

Backport of 214fb70 from master
  • Loading branch information...
commit dc0bf53276f28421006d041dc21c7dc8d0393b2d 1 parent 3471839
Tim Graham authored January 22, 2013
2  django/contrib/contenttypes/generic.py
@@ -430,7 +430,7 @@ def generic_inlineformset_factory(model, form=ModelForm,
430 430
                                   max_num=None,
431 431
                                   formfield_callback=None):
432 432
     """
433  
-    Returns an ``GenericInlineFormSet`` for the given kwargs.
  433
+    Returns a ``GenericInlineFormSet`` for the given kwargs.
434 434
 
435 435
     You must provide ``ct_field`` and ``object_id`` if they different from the
436 436
     defaults ``content_type`` and ``object_id`` respectively.
31  docs/ref/contrib/contenttypes.txt
@@ -452,14 +452,18 @@ need to calculate them without using the aggregation API.
452 452
 Generic relations in forms and admin
453 453
 ------------------------------------
454 454
 
455  
-The :mod:`django.contrib.contenttypes.generic` module provides
456  
-``BaseGenericInlineFormSet``,
457  
-:class:`~django.contrib.contenttypes.generic.GenericTabularInline`
458  
-and :class:`~django.contrib.contenttypes.generic.GenericStackedInline`
459  
-(the last two are subclasses of
460  
-:class:`~django.contrib.contenttypes.generic.GenericInlineModelAdmin`).
461  
-This enables the use of generic relations in forms and the admin. See the
462  
-:doc:`model formset </topics/forms/modelforms>` and
  455
+The :mod:`django.contrib.contenttypes.generic` module provides:
  456
+
  457
+* ``BaseGenericInlineFormSet``
  458
+* :class:`~django.contrib.contenttypes.generic.GenericTabularInline`
  459
+  and :class:`~django.contrib.contenttypes.generic.GenericStackedInline`
  460
+  (subclasses of
  461
+  :class:`~django.contrib.contenttypes.generic.GenericInlineModelAdmin`)
  462
+* A formset factory, :func:`generic_inlineformset_factory`, for use with
  463
+  :class:`GenericForeignKey`
  464
+
  465
+These classes and functions enable the use of generic relations in forms
  466
+and the admin. See the :doc:`model formset </topics/forms/modelforms>` and
463 467
 :ref:`admin <using-generic-relations-as-an-inline>` documentation for more
464 468
 information.
465 469
 
@@ -486,3 +490,14 @@ information.
486 490
 
487 491
     Subclasses of :class:`GenericInlineModelAdmin` with stacked and tabular
488 492
     layouts, respectively.
  493
+
  494
+.. function:: generic_inlineformset_factory(model, form=ModelForm, formset=BaseGenericInlineFormSet, ct_field="content_type", fk_field="object_id", fields=None, exclude=None, extra=3, can_order=False, can_delete=True, max_num=None, formfield_callback=None)
  495
+
  496
+    Returns a ``GenericInlineFormSet`` using
  497
+    :func:`~django.forms.models.modelformset_factory`.
  498
+
  499
+    You must provide ``ct_field`` and ``object_id`` if they different from the
  500
+    defaults, ``content_type`` and ``object_id`` respectively. Other parameters
  501
+    are similar to those documented in
  502
+    :func:`~django.forms.models.modelformset_factory` and
  503
+    :func:`~django.forms.models.inlineformset_factory`.

0 notes on commit dc0bf53

Please sign in to comment.
Something went wrong with that request. Please try again.