Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

Backport of r13542 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13544 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 3309c394382dd4147f3c8c9acb8afee7f974f19b 1 parent e990a2c
@freakboy3742 freakboy3742 authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 docs/ref/contrib/admin/index.txt
View
5 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
Please sign in to comment.
Something went wrong with that request. Please try again.