Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.2.X] 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.

Backport of [15124] from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15125 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit e501f502370b829d0bb2f1ed9c6e94bbfa5206f6 1 parent fa4ac6f
Ramiro Morales authored December 31, 2010
17  docs/ref/contrib/admin/index.txt
@@ -1287,6 +1287,8 @@ Finally, register your ``Person`` and ``Group`` models with the admin site::
1287 1287
 Now your admin site is set up to edit ``Membership`` objects inline from
1288 1288
 either the ``Person`` or the ``Group`` detail pages.
1289 1289
 
  1290
+.. _using-generic-relations-as-an-inline:
  1291
+
1290 1292
 Using generic relations as an inline
1291 1293
 ------------------------------------
1292 1294
 
@@ -1303,9 +1305,12 @@ you have the following models::
1303 1305
         name = models.CharField(max_length=100)
1304 1306
 
1305 1307
 If you want to allow editing and creating ``Image`` instance on the ``Product``
1306  
-add/change views you can simply use ``GenericInlineModelAdmin`` provided by
1307  
-``django.contrib.contenttypes.generic``. In your ``admin.py`` for this
1308  
-example app::
  1308
+add/change views you can use ``GenericTabularInline`` or
  1309
+``GenericStackedInline`` (both subclasses of ``GenericInlineModelAdmin``)
  1310
+provided by ``django.contrib.contenttypes.generic``, they implement tabular and
  1311
+stacked visual layouts for the forms representing the inline objects
  1312
+respectively just like their non-generic counterparts and behave just like any
  1313
+other inline. In your ``admin.py`` for this example app::
1309 1314
 
1310 1315
     from django.contrib import admin
1311 1316
     from django.contrib.contenttypes import generic
@@ -1322,10 +1327,8 @@ example app::
1322 1327
 
1323 1328
     admin.site.register(Product, ProductAdmin)
1324 1329
 
1325  
-``django.contrib.contenttypes.generic`` provides both a ``GenericTabularInline``
1326  
-and ``GenericStackedInline`` and behave just like any other inline. See the
1327  
-:doc:`contenttypes documentation </ref/contrib/contenttypes>` for more specific
1328  
-information.
  1330
+See the :doc:`contenttypes documentation </ref/contrib/contenttypes>` for more
  1331
+specific information.
1329 1332
 
1330 1333
 Overriding Admin Templates
1331 1334
 ==========================
11  docs/ref/contrib/contenttypes.txt
@@ -359,12 +359,15 @@ relations, you'll need to calculate them without using the aggregation API.
359 359
 Generic relations in forms and admin
360 360
 ------------------------------------
361 361
 
362  
-:mod:`django.contrib.contenttypes.generic` provides both a
363  
-:class:`~django.contrib.contenttypes.generic.GenericInlineFormSet`
364  
-and :class:`~django.contrib.contenttypes.generic.GenericInlineModelAdmin`.
  362
+:mod:`django.contrib.contenttypes.generic` provides
  363
+:class:`~django.contrib.contenttypes.generic.GenericInlineFormSet`,
  364
+:class:`~django.contrib.contenttypes.generic.GenericTabularInline`
  365
+and :class:`~django.contrib.contenttypes.generic.GenericStackedInline`
  366
+(the last two subclasses of :class:`~django.contrib.contenttypes.generic.GenericInlineModelAdmin`).
365 367
 This enables the use of generic relations in forms and the admin. See the
366 368
 :doc:`model formset </topics/forms/modelforms>` and
367  
-:doc:`admin </ref/contrib/admin/index>` documentation for more information.
  369
+:ref:`admin <using-generic-relations-as-an-inline>` documentation for more
  370
+information.
368 371
 
369 372
 .. class:: generic.GenericInlineModelAdmin
370 373
 

0 notes on commit e501f50

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