summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorGavin Wahl <gwahl@fusionbox.com>2013-05-20 11:51:05 -0600
committerSimon Charette <charette.s@gmail.com>2013-05-23 19:03:14 -0400
commit48424adaba74379eee311b3d1519f011212357ad (patch)
treee038270882eca666181d8fbde8cd13381857f4cd /docs/ref
parent8dda8a5ecc8f481364dc8f58b4ba319e5b016679 (diff)
Fixed #17648 -- Add `for_concrete_model` to `GenericForeignKey`.
Allows a `GenericForeignKey` to reference proxy models. The default for `for_concrete_model` is `True` to keep backwards compatibility. Also added the analog `for_concrete_model` kwarg to `generic_inlineformset_factory` to provide an API at the form level.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/contenttypes.txt17
1 files changed, 16 insertions, 1 deletions
diff --git a/docs/ref/contrib/contenttypes.txt b/docs/ref/contrib/contenttypes.txt
index 1bb0802442..de9c5dcbd6 100644
--- a/docs/ref/contrib/contenttypes.txt
+++ b/docs/ref/contrib/contenttypes.txt
@@ -303,6 +303,15 @@ model:
:class:`~django.contrib.contenttypes.generic.GenericForeignKey` will
look for.
+ .. attribute:: GenericForeignKey.for_concrete_model
+
+ .. versionadded:: 1.6
+
+ If ``False``, the field will be able to reference proxy models. Default
+ is ``True``. This mirrors the ``for_concrete_model`` argument to
+ :meth:`~django.contrib.contenttypes.models.ContentTypeManager.get_for_model`.
+
+
.. admonition:: Primary key type compatibility
The "object_id" field doesn't have to be the same type as the
@@ -492,7 +501,7 @@ information.
Subclasses of :class:`GenericInlineModelAdmin` with stacked and tabular
layouts, respectively.
-.. 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, validate_max=False)
+.. 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, validate_max=False, for_concrete_model=True)
Returns a ``GenericInlineFormSet`` using
:func:`~django.forms.models.modelformset_factory`.
@@ -502,3 +511,9 @@ information.
are similar to those documented in
:func:`~django.forms.models.modelformset_factory` and
:func:`~django.forms.models.inlineformset_factory`.
+
+ .. versionadded:: 1.6
+
+ The ``for_concrete_model`` argument corresponds to the
+ :class:`~django.contrib.contenttypes.generic.GenericForeignKey.for_concrete_model`
+ argument on ``GenericForeignKey``.