From 2904c1d4b33fb4612291db9d46fff56842854e58 Mon Sep 17 00:00:00 2001 From: Brian Rosner Date: Fri, 1 Aug 2008 19:47:26 +0000 Subject: [PATCH] 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 --- docs/admin.txt | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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 (