summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Rosner <brosner@gmail.com>2008-08-01 19:47:26 +0000
committerBrian Rosner <brosner@gmail.com>2008-08-01 19:47:26 +0000
commit2904c1d4b33fb4612291db9d46fff56842854e58 (patch)
treeb9f1b9ab6252404d5b69f68230c54e4d682f71cb
parente7508a456ea97ec513507149280ab36cde271738 (diff)
Clarified the raw_id_fields documentation and added it to InlineModelAdmin options section. Added examples as well. Fixes #7905. Thanks Matthew Flanagan for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8176 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--docs/admin.txt20
1 files changed, 19 insertions, 1 deletions
diff --git a/docs/admin.txt b/docs/admin.txt
index 33e9ede4c2..2894b1d57c 100644
--- a/docs/admin.txt
+++ b/docs/admin.txt
@@ -421,7 +421,10 @@ overhead of having to select all the related instances to display in the
drop-down.
``raw_id_fields`` is a list of fields you would like to change
-into a ``Input`` widget for the primary key.
+into a ``Input`` widget for either a ``ForeignKey`` or ``ManyToManyField``::
+
+ class ArticleAdmin(admin.ModelAdmin):
+ raw_id_fields = ("newspaper",)
``save_as``
~~~~~~~~~~~
@@ -598,6 +601,21 @@ enough. See `max_num in formsets`_ for more information.
.. _max_num in formsets: ../modelforms/#limiting-the-number-of-objects-editable
+``raw_id_fields``
+~~~~~~~~~~~~~~~~~
+
+By default, Django's admin uses a select-box interface (<select>) for
+fields that are ``ForeignKey``. Sometimes you don't want to incur the
+overhead of having to select all the related instances to display in the
+drop-down.
+
+``raw_id_fields`` is a list of fields you would like to change
+into a ``Input`` widget for either a ``ForeignKey`` or ``ManyToManyField``::
+
+ class BookInline(admin.TabularInline):
+ model = Book
+ raw_id_fields = ("pages",)
+
``template``
~~~~~~~~~~~~