diff options
Diffstat (limited to 'tools/pharos-dashboard/dashboard/models.py')
-rw-r--r-- | tools/pharos-dashboard/dashboard/models.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/pharos-dashboard/dashboard/models.py b/tools/pharos-dashboard/dashboard/models.py index 973066b8..cb6b92b3 100644 --- a/tools/pharos-dashboard/dashboard/models.py +++ b/tools/pharos-dashboard/dashboard/models.py @@ -1,14 +1,17 @@ from django.contrib.auth.models import User from django.db import models +from django.utils import timezone + +from jenkins.models import JenkinsSlave class Resource(models.Model): id = models.AutoField(primary_key=True) name = models.CharField(max_length=100, unique=True) - slavename = models.CharField(max_length=50, blank=True, null=True) description = models.CharField(max_length=300, blank=True, null=True) url = models.CharField(max_length=100, blank=True, null=True) owners = models.ManyToManyField(User) + slave = models.ForeignKey(JenkinsSlave, on_delete=models.DO_NOTHING) class Meta: db_table = 'resource' @@ -16,6 +19,7 @@ class Resource(models.Model): def __str__(self): return self.name + class ResourceUtilization(models.Model): POD_STATUS = { 'online': 1, @@ -25,4 +29,4 @@ class ResourceUtilization(models.Model): id = models.AutoField(primary_key=True) timestamp = models.DateTimeField(auto_created=True) - pod_status = models.IntegerField()
\ No newline at end of file + pod_status = models.IntegerField() |