summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-08-07 07:57:15 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-08-07 07:57:15 +0000
commitbafe9fdef2060f315a6b37f8eeffc1af1492c565 (patch)
treef6d36bc881701f699a97b27cd8a9a742c120949c /docs
parent244e7b9334beb6d61814b849445a128aa0ce3c9e (diff)
Fixed #7284 -- Provided an example for the use of the search_fields clause on ModelAdmin. Thanks to rbell01824@earthlink.net for the suggestion, and Simon Meers for the initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13542 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/admin/index.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
index 4d84dfafbc..d527b30ced 100644
--- a/docs/ref/contrib/admin/index.txt
+++ b/docs/ref/contrib/admin/index.txt
@@ -600,6 +600,11 @@ the lookup API "follow" notation::
search_fields = ['foreign_key__related_fieldname']
+For example, if you have a blog entry with an author, the following definition
+would enable search blog entries by the email address of the author::
+
+ search_fields = ['user__email']
+
When somebody does a search in the admin search box, Django splits the search
query into words and returns all objects that contain each of the words, case
insensitive, where each word must be in at least one of ``search_fields``. For