add view for device details

This commit is contained in:
Andreas Zweili 2017-12-25 13:35:09 +01:00
parent 7375d097f5
commit 44456f0c0d
2 changed files with 16 additions and 0 deletions

View File

@ -395,6 +395,14 @@ def index(request):
'inventory/index.html',
{'device_list': device_list,
'computer_list': computer_list})
def device_details(request, device_id):
device = get_object_or_404(Device, pk=device_id)
return render(request, 'inventory/device_details.html',
{'device': device})
* URLs
The urls.py files contain the definitions for the URLs. This means you

View File

@ -14,3 +14,11 @@ def index(request):
'inventory/index.html',
{'device_list': device_list,
'computer_list': computer_list})
def device_details(request, device_id):
device = get_object_or_404(Device, pk=device_id)
return render(request, 'inventory/device_details.html',
{'device': device})