added first public views - no check for access rights at the moment
This commit is contained in:
13
content/views/public.py
Normal file
13
content/views/public.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
from content.models import Question
|
||||
|
||||
|
||||
def search_question(request):
|
||||
term = request.GET.get('term')
|
||||
items = []
|
||||
if term:
|
||||
items = Question.get_by_tearchterm(term)
|
||||
else:
|
||||
items = Question.objects.all()[:10]
|
||||
return render(request, 'questions.html', {'items': items})
|
||||
Reference in New Issue
Block a user