diff options
author | Jack Morgan <jack.morgan@intel.com> | 2016-08-29 18:25:32 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-08-29 18:25:32 +0000 |
commit | e70af736b5c9152f5c8c3b1a44b3a1ddf286cb2c (patch) | |
tree | 6be74477e31e9ad106d83974a49d5e14ebdb3bb0 /tools/pharos-dashboard/dashboard/models.py | |
parent | c3338109091fe880d7dd40966b9e7aa2ad7fd132 (diff) | |
parent | b67557fdf3ddab95d2834c8aa01dcc0d120685dd (diff) |
Merge "Add a Resource detail view"
Diffstat (limited to 'tools/pharos-dashboard/dashboard/models.py')
-rw-r--r-- | tools/pharos-dashboard/dashboard/models.py | 19 |
1 files changed, 17 insertions, 2 deletions
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 |