How to make case insensitive filter queries with Google App Engine?

前端 未结 2 1035
小蘑菇
小蘑菇 2020-12-03 21:17

I am working on a GAE Django Project where I have to implementing the search functionality, I have written a query and it fetches the data according to the search keyword.

2条回答
  •  感动是毒
    2020-12-03 22:02

    An alternative solution to this problem - where the datasets are small - is to filter the results in python after you have called them from the datastore:

    for each_item in list_of_results:
        if each_item.name.lower().rfind(your_search_term) != -1:
            #Your results action
    

提交回复
热议问题