1
0
mirror of https://github.com/Damillora/Altessimo synced 2024-10-31 21:17:32 +00:00

Case insensitive search

This commit is contained in:
Damillora 2020-12-17 22:59:22 +07:00
parent 0ed9d7b1d5
commit ed4c2065b6
2 changed files with 2 additions and 2 deletions

View File

@ -9,7 +9,7 @@ def artist_index(request):
objs = {}
if "q" in request.GET:
q = request.GET['q']
artists = Artist.objects.filter(name__contains=q) | Artist.objects.filter(romanized_name__contains=q)
artists = Artist.objects.filter(name__icontains=q) | Artist.objects.filter(romanized_name__icontains=q)
objs['q'] = q
objs['artists'] = artists
return render(request,'artists/index.html',objs)

View File

@ -8,7 +8,7 @@ def song_index(request):
objs = {}
if "q" in request.GET:
q = request.GET['q']
songs = Song.objects.filter(title__contains=q) | Song.objects.filter(romanized_title__contains=q)
songs = Song.objects.filter(title__icontains=q) | Song.objects.filter(romanized_title__icontains=q)
objs['q'] = q
paginator = Paginator(songs, 100)
page_number = request.GET.get('page',1)