KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have troubles using the search_fields when the search expression has multiple words and i want to perform a startswith search I have a class class Foo(models.Model): kw = models.CharField(max_length = 255) ... class FooAdmin(admin.ModelAdmin): search_fields = ('^kw',) The '^' indicates that i want to perform a startswith search. If i'm looking for the kw 'foo fuu', django will perform the query: select * from app_foo where `foo`.`kw` like 'foo%' and `foo`.`kw` like 'fuu%' This query obviously gives zero results. What should i do to make the engine looking for 'foo fuu%' ?
Tags (comma-separated)
Save Edits
Cancel