Add box detail page with thumbnails and view tests
Some checks failed
Build containers when image tags change / build-if-image-changed (., web, containers, main container, git.baumann.gr/adebaumann/labhelper) (push) Successful in 2m26s
Build containers when image tags change / build-if-image-changed (data-loader, loader, initContainers, init-container, git.baumann.gr/adebaumann/labhelper-data-loader) (push) Successful in 23s
SonarQube Scan / SonarQube Trigger (push) Failing after 19s
Some checks failed
Build containers when image tags change / build-if-image-changed (., web, containers, main container, git.baumann.gr/adebaumann/labhelper) (push) Successful in 2m26s
Build containers when image tags change / build-if-image-changed (data-loader, loader, initContainers, init-container, git.baumann.gr/adebaumann/labhelper-data-loader) (push) Successful in 23s
SonarQube Scan / SonarQube Trigger (push) Failing after 19s
This commit is contained in:
@@ -1,7 +1,20 @@
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import get_object_or_404, render
|
||||
|
||||
from .models import Box
|
||||
|
||||
|
||||
def index(request):
|
||||
"""Simple index page."""
|
||||
html = '<h1>LabHelper</h1><p><a href="/admin/">Admin</a></p>'
|
||||
return HttpResponse(html)
|
||||
|
||||
|
||||
def box_detail(request, box_id):
|
||||
"""Display contents of a box."""
|
||||
box = get_object_or_404(Box, pk=box_id)
|
||||
things = box.things.select_related('thing_type').all()
|
||||
return render(request, 'boxes/box_detail.html', {
|
||||
'box': box,
|
||||
'things': things,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user