小编Hra*_*yan的帖子

Django:icontains大小写对Unicode敏感

我正在对我的博客进行简单搜索。我使用亚美尼亚语,搜索时对这些字母总是很敏感。这是我的代码的一部分。先感谢您。

search_query = get.get('search')
query_list = search_query.split()
posts = post.objects.filter(
                reduce(operator.and_,
                       (Q(title__icontains=q) for q in query_list))|
                reduce(operator.and_,
                       (Q(content__icontains=q) for q in query_list)),
            )
Run Code Online (Sandbox Code Playgroud)

python django unicode search-engine django-models

0
推荐指数
1
解决办法
498
查看次数

标签 统计

django ×1

django-models ×1

python ×1

search-engine ×1

unicode ×1