Ticket #6220: unicode_search_fields.diff

File unicode_search_fields.diff, 799 bytes (added by Robert Bunting <robert@…>, 17 years ago)

apply smart_str to search_fields in admin.

  • django/django/contrib/admin/views/main.py

     
    752752
    753753        if self.lookup_opts.admin.search_fields and self.query:
    754754            for bit in self.query.split():
    755                 or_queries = [models.Q(**{construct_search(field_name): bit}) for field_name in self.lookup_opts.admin.search_fields]
     755                or_queries = [models.Q(**{construct_search(smart_str(field_name)): bit}) for field_name in self.lookup_opts.admin.search_fields]
    756756                other_qs = QuerySet(self.model)
    757757                if qs._select_related:
    758758                    other_qs = other_qs.select_related()
Back to Top