﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
2197	[patch] Generic search interface	Matias Hermanrud Fjeld <mhf@…>	nobody	"This patch moves searching from the admin interface to querysets, and implements searching in django.views.generic.list_detail.object_detail.

All querysets get a new search()-method, wich takes a query string and optionally a list of fields to search. By default the fields in model._meta.search_fields
are searched.

'''The patch is backwards-incompatible.''' The ''search_fields''-option goes in ''Meta'' instead of ''Admin'':

{{{
#!python

class Toy(models.Model):
    name = models.CharField(maxlength=50)

    class Meta:
        search_fields = ['name']

    class Admin:
        pass
}}}

When fetching objects, one can do:

{{{
#!python
from myapp.models import Toy

# i like things that roll
Toy.objects.search('ball wheel')
}}}

Please comment."	enhancement	closed	Database layer (models, ORM)		normal	wontfix	feature_request		Design decision needed	1	0	0	0	0	0
