M
M
Masha_Fomina2016-08-11 19:01:21
Django
Masha_Fomina, 2016-08-11 19:01:21

How to make search_fields case-insensitive for the Russian language in the Django admin panel?

I add a search field in the admin panel. The documentation says that the search is case-insensitive. If you search in English, then it is. But in Russian, for some reason, it is not like that. Why might this be?

class HtmlPartAdmin(admin.ModelAdmin):
    list_display = ('title', 'get_text', 'slug', )
    list_display_links = ('title', )
    search_fields = ('title', 'text')
    prepopulated_fields = {'slug': ('title',)}

admin.site.register(HtmlPart, HtmlPartAdmin)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Kitaev, 2016-08-11
@deliro

SQLite is not friendly with the Russian language and search. Use postgres.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question