Fixed #3346 -- Documented that search_fields Admin option can use related models. Thanks for the patch, Robert Myers and Gary Wilson

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4392 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2007-01-23 02:01:20 +00:00
parent 2e042f33e3
commit 9afddbe422
1 changed files with 4 additions and 1 deletions

View File

@ -1408,7 +1408,10 @@ This should be set to a list of field names that will be searched whenever
somebody submits a search query in that text box. somebody submits a search query in that text box.
These fields should be some kind of text field, such as ``CharField`` or These fields should be some kind of text field, such as ``CharField`` or
``TextField``. ``TextField``. You can also perform a related lookup on a ``ForeignKey`` with
the lookup API "follow" notation::
search_fields = ['foreign_key__related_fieldname']
When somebody does a search in the admin search box, Django splits the search 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 query into words and returns all objects that contain each of the words, case