added is_pushed and some "styling"

This commit is contained in:
Holger Sielaff
2024-07-13 10:19:49 +02:00
parent 3640ab759d
commit e7b2dff233
7 changed files with 24 additions and 13 deletions

View File

@@ -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})