Show More
@@ -1,5 +1,6 b'' | |||
|
1 | 1 | from django.shortcuts import render |
|
2 | 2 | from django.views.generic import View |
|
3 | from django.db.models import Q | |
|
3 | 4 | |
|
4 | 5 | from boards.abstracts.paginator import get_paginator |
|
5 | 6 | from boards.forms import SearchForm, PlainErrorList |
@@ -32,8 +33,8 b' class BoardSearchView(View):' | |||
|
32 | 33 | if form.is_valid(): |
|
33 | 34 | query = form.cleaned_data[FORM_QUERY] |
|
34 | 35 | if len(query) >= MIN_QUERY_LENGTH: |
|
35 |
results = Post.objects.filter(text__icontains=query) |
|
|
36 | .order_by('-id') | |
|
36 | results = Post.objects.filter(Q(text__icontains=query) | | |
|
37 | Q(title__icontains=query)).order_by('-id') | |
|
37 | 38 | paginator = get_paginator(results, RESULTS_PER_PAGE) |
|
38 | 39 | |
|
39 | 40 | page = int(request.GET.get(REQUEST_PAGE, '1')) |
General Comments 0
You need to be logged in to leave comments.
Login now