1 ##############################################################################
2 # Copyright (c) 2018 Sawyer Bergeron, Parker Berberian, and others.
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 ##############################################################################
11 from django.shortcuts import render
12 from django.views import View
13 from django.views.generic import TemplateView
15 from resource_inventory.models import Host
17 class HostView(TemplateView):
18 template_name = "resource/hosts.html"
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"})