mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #211 -- edit_inline_type is deprecated, in favor of edit_inline itself. For example, instead of 'edit_inline=True, edit_inline_type=meta.TABULAR', use 'edit_inline=meta.TABULAR'.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@440 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -20,7 +20,7 @@ Throughout this reference, we'll refer to the following Poll application::
|
||||
|
||||
class Choice(meta.Model):
|
||||
fields = (
|
||||
meta.ForeignKey(Poll, edit_inline=True, edit_inline_type=meta.TABULAR,
|
||||
meta.ForeignKey(Poll, edit_inline=meta.TABULAR,
|
||||
num_in_admin=10, min_num_in_admin=5),
|
||||
meta.CharField('choice', maxlength=255, core=True),
|
||||
meta.IntegerField('votes', editable=False, default=0),
|
||||
|
||||
@@ -316,16 +316,13 @@ Field Types
|
||||
======================= ============================================================
|
||||
Argument Description
|
||||
======================= ============================================================
|
||||
``edit_inline`` If ``True``, this related object is edited
|
||||
``edit_inline`` If not ``False``, this related object is edited
|
||||
"inline" on the related object's page. This means
|
||||
that the object will not have its own admin
|
||||
interface.
|
||||
|
||||
``edit_inline_type`` This is either ``meta.TABULAR`` or
|
||||
``meta.STACKED`` and controls whether the inline
|
||||
editable objects are displayed as a table or as
|
||||
a "stack" of fieldsets. Defaults to
|
||||
``meta.STACKED``.
|
||||
interface. Use either ``meta.TABULAR`` or ``meta.STACKED``,
|
||||
which, respectively, designate whether the inline-editable
|
||||
objects are displayed as a table or as a "stack" of
|
||||
fieldsets.
|
||||
|
||||
``limit_choices_to`` A dictionary of lookup arguments and values (see
|
||||
the `Database API reference`_) that limit the
|
||||
|
||||
@@ -242,7 +242,7 @@ Poll object. Let's make that happen.
|
||||
Remove the ``admin`` for the Choice model. Then, edit the ``ForeignKey(Poll)``
|
||||
field like so::
|
||||
|
||||
meta.ForeignKey(Poll, edit_inline=True, num_in_admin=3),
|
||||
meta.ForeignKey(Poll, edit_inline=meta.STACKED, num_in_admin=3),
|
||||
|
||||
This tells Django: "Choice objects are edited on the Poll admin page. By
|
||||
default, provide enough fields for 3 Choices."
|
||||
@@ -274,10 +274,10 @@ One small problem, though. It takes a lot of screen space to display all the
|
||||
fields for entering related Choice objects. For that reason, Django offers an
|
||||
alternate way of displaying inline related objects::
|
||||
|
||||
meta.ForeignKey(Poll, edit_inline=True, num_in_admin=3, edit_inline_type=meta.TABULAR),
|
||||
meta.ForeignKey(Poll, edit_inline=meta.TABULAR, num_in_admin=3),
|
||||
|
||||
With that ``edit_inline_type=meta.TABULAR``, the related objects are displayed
|
||||
in a more compact, table-based format:
|
||||
With that ``edit_inline=meta.TABULAR`` (instead of ``meta.STACKED``), the
|
||||
related objects are displayed in a more compact, table-based format:
|
||||
|
||||
.. image:: http://media.djangoproject.com/img/doc/tutorial/admin12.png
|
||||
:alt: Add poll page now has more compact choices
|
||||
|
||||
Reference in New Issue
Block a user