forked from wiktor/spejstore-new
better index
This commit is contained in:
parent
1587f26181
commit
d313274615
|
@ -56,7 +56,9 @@ def apply_smart_search(query, objects):
|
||||||
|
|
||||||
|
|
||||||
def index(request):
|
def index(request):
|
||||||
return render(request, 'index.html')
|
return render(request, 'results.html', {
|
||||||
|
'results': Item.get_roots()
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
def search(request):
|
def search(request):
|
||||||
|
@ -75,9 +77,7 @@ def search(request):
|
||||||
|
|
||||||
def item_display(request, pk):
|
def item_display(request, pk):
|
||||||
if not pk:
|
if not pk:
|
||||||
return render(request, 'results.html', {
|
return index(request)
|
||||||
'results': Item.get_roots()
|
|
||||||
})
|
|
||||||
item = get_object_or_404(Item, pk=pk)
|
item = get_object_or_404(Item, pk=pk)
|
||||||
|
|
||||||
labels = item.labels.all()
|
labels = item.labels.all()
|
||||||
|
|
Loading…
Reference in New Issue