Django Book 翻译
菜单>:
TOC
返回
原文:
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 example, if ``search_fields`` is set to ``['first_name', 'last_name']`` and a user searches for ``john lennon`` , Django will do the equivalent of this SQL ``WHERE`` clause:
翻译:
当某人在管理查询框执行一次搜索时,Django 把查询内容切分成单词,并且返回包含了每个单词的所有对象,它们大写写敏感,并且每个单词必须出现在 ``查询字段`` (``search_fields``)中的一个。举个例子,如果查询字段被设置成 ``['first_name', 'last_name']`` ,一个用户查找 ``john lennon`` ,Django 会执行和SQL的 ``WHERE`` 语句相同的事情。
备注:
译者: