Lab as a Service 2.0
[pharos-tools.git] / dashboard / src / resource_inventory / views.py
1 ##############################################################################
2 # Copyright (c) 2018 Sawyer Bergeron, Parker Berberian, and others.
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9
10
11 from django.shortcuts import render
12 from django.views import View
13 from django.views.generic import TemplateView
14
15 from resource_inventory.models import Host
16
17 class HostView(TemplateView):
18     template_name = "resource/hosts.html"
19
20     def get_context_data(self, **kwargs):
21         context = super(HostView, self).get_context_data(**kwargs)
22         hosts = Host.objects.filter(working=True)
23         context.update({'hosts':hosts, 'title':"Hardware Resources"})
24         return context