From b67557fdf3ddab95d2834c8aa01dcc0d120685dd Mon Sep 17 00:00:00 2001 From: maxbr Date: Thu, 25 Aug 2016 12:10:55 +0200 Subject: Add a Resource detail view JIRA: RELENG-12 The resource page contains an utilization diagram, future bookings with their jira tickets and a list of servers. Change-Id: I2123ccbe96cde29a56af32b933ebbf6ba2668ed1 Signed-off-by: maxbr --- tools/pharos-dashboard/dashboard/models.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'tools/pharos-dashboard/dashboard/models.py') diff --git a/tools/pharos-dashboard/dashboard/models.py b/tools/pharos-dashboard/dashboard/models.py index 971af6a2..d645cd55 100644 --- a/tools/pharos-dashboard/dashboard/models.py +++ b/tools/pharos-dashboard/dashboard/models.py @@ -1,6 +1,5 @@ from django.contrib.auth.models import User from django.db import models -from django.utils import timezone from jenkins.models import JenkinsSlave @@ -17,4 +16,20 @@ class Resource(models.Model): db_table = 'resource' def __str__(self): - return self.name \ No newline at end of file + return self.name + + +class Server(models.Model): + id = models.AutoField(primary_key=True) + resource = models.ForeignKey(Resource, on_delete=models.CASCADE) + name = models.CharField(max_length=100, blank=True) + model = models.CharField(max_length=100, blank=True) + cpu = models.CharField(max_length=100, blank=True) + ram = models.CharField(max_length=100, blank=True) + storage = models.CharField(max_length=100, blank=True) + + class Meta: + db_table = 'server' + + def __str__(self): + return self.name -- cgit 1.2.3-korg