﻿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
10877	search_fields raise TypeError if field names are given as unicode objects.	Cliff Dyer	nobody	"If you specify field names in search_fields as unicode objects, when you search you get the following exception:

{{{
  Exception Type:  	TypeError
  Exception Value: 	__init__() keywords must be strings
  Exception Location: 	/usr/lib/python2.4/site-packages/django/contrib/admin/views/main.py in get_query_set, line 230
}}}

For example, the following code raises this {{{TypeError}}}:

{{{
from django.contrib import admin
class MyAdmin(admin.ModelAdmin)
    search_fields = [u'title']
}}}

This can be worked around by converting such unicode specified field names to strings:

{{{
    search_fields = [str(field) for field in unicode_search_fields]
}}}

Other similar specifiers, such as 'list_filter' and 'exclude' handle unicode objects the same way they handle strings.

"		closed	contrib.admin	1.0		worksforme			Unreviewed	0	0	0	0	0	0
