diff options
| author | Ramiro Morales <cramm0@gmail.com> | 2010-12-31 23:02:07 +0000 |
|---|---|---|
| committer | Ramiro Morales <cramm0@gmail.com> | 2010-12-31 23:02:07 +0000 |
| commit | 70c8cd41009b5776caf6091e5a0b8a989204d069 (patch) | |
| tree | 92925f7901a55c0418529771b681d846e57370d6 /docs/ref/contrib/admin | |
| parent | 5a36b43c2721d6e679ddb952c33c28609ee829e2 (diff) | |
Fixed #13307 -- Enhanced the generic inlines documentation by mentioning the concrete Generic{Tabular,Stacked}Inline classes that should be used. Thanks loki77 for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15124 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/ref/contrib/admin')
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index d76d61f0b3..326bca4d18 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -1364,6 +1364,8 @@ Finally, register your ``Person`` and ``Group`` models with the admin site:: Now your admin site is set up to edit ``Membership`` objects inline from either the ``Person`` or the ``Group`` detail pages. +.. _using-generic-relations-as-an-inline: + Using generic relations as an inline ------------------------------------ @@ -1380,9 +1382,12 @@ you have the following models:: name = models.CharField(max_length=100) If you want to allow editing and creating ``Image`` instance on the ``Product`` -add/change views you can simply use ``GenericInlineModelAdmin`` provided by -``django.contrib.contenttypes.generic``. In your ``admin.py`` for this -example app:: +add/change views you can use ``GenericTabularInline`` or +``GenericStackedInline`` (both subclasses of ``GenericInlineModelAdmin``) +provided by ``django.contrib.contenttypes.generic``, they implement tabular and +stacked visual layouts for the forms representing the inline objects +respectively just like their non-generic counterparts and behave just like any +other inline. In your ``admin.py`` for this example app:: from django.contrib import admin from django.contrib.contenttypes import generic @@ -1399,10 +1404,8 @@ example app:: admin.site.register(Product, ProductAdmin) -``django.contrib.contenttypes.generic`` provides both a ``GenericTabularInline`` -and ``GenericStackedInline`` and behave just like any other inline. See the -:doc:`contenttypes documentation </ref/contrib/contenttypes>` for more specific -information. +See the :doc:`contenttypes documentation </ref/contrib/contenttypes>` for more +specific information. Overriding Admin Templates ========================== |
