ignore case

This commit is contained in:
root 2017-12-19 12:26:04 +00:00
parent e56f40d991
commit fd976735d6

View File

@ -125,7 +125,9 @@ def page(request, shortname):
def search(request):
q = request.GET.get('q')
results = Content.objects.filter(Q(body__contains=q) | Q(title__contains=q)).distinct().order_by('-datestart')
results = Content.objects.filter(Q(body__icontains=q) | Q(title__icontains=q)).distinct()
results = results.filter(published=True)
results = results.order_by('-datestart')
page = request.GET.get('page', 1)
paginator = Paginator(results, 5)
try: