Is there any way to do a case-insensitive IN query in Django?
问题 Nearly every kind of lookup in Django has a case-insensitive version, EXCEPT in, it appears. This is a problem because sometimes I need to do a lookup where I am certain the case will be incorrect. Products.objects.filter(code__in=[user_entered_data_as_list]) Is there anything I can do to deal with this? Have people come up with a hack to work around this issue? 回答1: I worked around this by making the MySQL database itself case-insensitive. I doubt that the people at Django are interested in