added is_pushed and some "styling"
This commit is contained in:
@@ -6,8 +6,9 @@ from content.models import Question
|
||||
def search_question(request):
|
||||
term = request.GET.get('term')
|
||||
items = []
|
||||
published = Question.objects.filter(is_published=True)
|
||||
if term:
|
||||
items = Question.get_by_tearchterm(term)
|
||||
items = Question.get_by_tearchterm(term, published)
|
||||
else:
|
||||
items = Question.objects.all()[:10]
|
||||
items = published.all()[:10]
|
||||
return render(request, 'questions.html', {'items': items})
|
||||
|
||||
Reference in New Issue
Block a user