icontains in Django QuerySet doesn't give the case insensitive result?
django, django-models, mysql, python
Solution
this is perhaps due to the mysql-db which you are using, may be your db table (name) column have the sql case-sensitive coollate
ALTER TABLE t1 MODIFY
col1 VARCHAR(5)
CHARACTER SET latin1
COLLATE latin1_swedish_ci;
Problem
I am using Django1.6, I am trying to use QuerySet filter, but it is behaving strangely. Here is my code: ``` test_listing = Test.objects.filter(site__id=_site_id, show_on_site=True) ``` Then I am trying to get the listing based on the searched text: ``` test_listing = test_listing.filter(name__icontains = searched_text) ``` I am using MySQL as database for my project. When I search for 'foo' it returns a blank list, but when I search for 'FOO', it returns the list of objects where there is an entry of FOOBAR as a name in my Test table. Why is it behaving so strangely...?