diff options
author | Sawyer Bergeron <sbergeron@iol.unh.edu> | 2019-03-19 16:22:31 -0400 |
---|---|---|
committer | Sawyer Bergeron <sbergeron@iol.unh.edu> | 2019-03-28 15:48:21 -0400 |
commit | 31dc78ea35cf207cb88a4e0cba93c89bc7010886 (patch) | |
tree | e0184fbb3f3af33d26868e83424fdc431db60c8c /src/resource_inventory/views.py | |
parent | 4816475aecde4d949e1a4d37b4f494573d7257bd (diff) |
Add host detail view
Change-Id: Ie385fe3f2fbe3b178f00928914d47a34b181d05e
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Diffstat (limited to 'src/resource_inventory/views.py')
-rw-r--r-- | src/resource_inventory/views.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/resource_inventory/views.py b/src/resource_inventory/views.py index 2937bd7..8c3d899 100644 --- a/src/resource_inventory/views.py +++ b/src/resource_inventory/views.py @@ -9,8 +9,10 @@ from django.views.generic import TemplateView +from django.shortcuts import get_object_or_404 +from django.shortcuts import render -from resource_inventory.models import Host +from resource_inventory.models import HostProfile, Host class HostView(TemplateView): @@ -21,3 +23,16 @@ class HostView(TemplateView): hosts = Host.objects.filter(working=True) context.update({'hosts': hosts, 'title': "Hardware Resources"}) return context + + +def hostprofile_detail_view(request, hostprofile_id): + hostprofile = get_object_or_404(HostProfile, id=hostprofile_id) + + return render( + request, + "resource/hostprofile_detail.html", + { + 'title': "Host Type: " + str(hostprofile.name), + 'hostprofile': hostprofile + } + ) |