On 8/15/06, Andy Dustman <[EMAIL PROTECTED]> wrote:
> In fact, it does LIKE %string%, which is quite expensive. Usually want
> I want out of an admin search is a startswith match, i.e. LIKE
> string%, which can use an index. Unfortunately there doesn't seem to
> be a way to do this yet. Maybe something like this:
>
>     class Admin:
>
>         search_fields = ["^last_name", "^first_name", "summary"]
>
> where a field name starting with ^ means to match the beginning. Looks
> like this could be done with a couple lines in
> django.contrib.admin.views.main.ChangeList.get_query_set()

That's a really nice idea, Andy! We would most certainly add that in,
if you wrote a patch.

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to