diff options
author | Sean Smith <ssmith@iol.unh.edu> | 2020-07-23 17:16:58 -0400 |
---|---|---|
committer | Sean Smith <ssmith@iol.unh.edu> | 2020-07-27 14:43:24 -0400 |
commit | a6de767f02153b46d964d551f10bc9561aa28d0c (patch) | |
tree | 40342ea9d42e510673a2dd35455d7e7f9411b478 /src/account/models.py | |
parent | 682f7ebb6d0be5ddd8e4c699e1f87fc20a3fe1e3 (diff) |
Make static OPNFV references dynamic
Change-Id: I3830a30a927834b642052643d94c39a9faec4d54
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
Diffstat (limited to 'src/account/models.py')
-rw-r--r-- | src/account/models.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/account/models.py b/src/account/models.py index 4aab306..03b31df 100644 --- a/src/account/models.py +++ b/src/account/models.py @@ -16,6 +16,7 @@ import random from collections import Counter + class LabStatus(object): """ A Poor man's enum for the status of a lab. @@ -204,6 +205,8 @@ class Lab(models.Model): # This token must apear in API requests from this lab api_token = models.CharField(max_length=50) description = models.CharField(max_length=240) + lab_info_link = models.URLField(null=True) + project = models.CharField(default='LaaS', max_length=100) @staticmethod def make_api_token(): @@ -216,7 +219,7 @@ class Lab(models.Model): def get_available_resources(self): # Cannot import model normally due to ciruclar import - Server = apps.get_model('resource_inventory', 'Server') # TODO: Find way to import ResourceQuery + Server = apps.get_model('resource_inventory', 'Server') # TODO: Find way to import ResourceQuery resources = [str(resource.profile) for resource in Server.objects.filter(lab=self, booked=False)] return dict(Counter(resources)) |