also search in title
This commit is contained in:
parent
9f33c16619
commit
e56f40d991
|
@ -125,7 +125,7 @@ def page(request, shortname):
|
||||||
|
|
||||||
def search(request):
|
def search(request):
|
||||||
q = request.GET.get('q')
|
q = request.GET.get('q')
|
||||||
results = Content.objects.filter(body__contains=q).order_by('-datestart')
|
results = Content.objects.filter(Q(body__contains=q) | Q(title__contains=q)).distinct().order_by('-datestart')
|
||||||
page = request.GET.get('page', 1)
|
page = request.GET.get('page', 1)
|
||||||
paginator = Paginator(results, 5)
|
paginator = Paginator(results, 5)
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user