data model changes for cmi_url in HpcService and support for multiple HPC services
diff --git a/xos/hpc/admin.py b/xos/hpc/admin.py
index c419a12..8333903 100644
--- a/xos/hpc/admin.py
+++ b/xos/hpc/admin.py
@@ -18,7 +18,7 @@
verbose_name_plural = "HPC Service"
list_display = ("backend_status_icon", "name","enabled")
list_display_links = ('backend_status_icon', 'name', )
- fieldsets = [(None, {'fields': ['backend_status_text', 'name','enabled','versionNumber', 'description'], 'classes':['suit-tab suit-tab-general']})]
+ fieldsets = [(None, {'fields': ['backend_status_text', 'name','enabled','versionNumber', 'description', "cmi_url"], 'classes':['suit-tab suit-tab-general']})]
readonly_fields = ('backend_status_text', )
inlines = [SliceInline,ServiceAttrAsTabInline]
@@ -92,7 +92,7 @@
list_display = ('backend_status_icon', 'name', 'description', 'enabled')
list_display_links = ('backend_status_icon', 'name', )
fieldsets = [
- (None, {'fields': ['backend_status_text', 'name','description','enabled'], 'classes':['suit-tab suit-tab-general']})]
+ (None, {'fields': ['backend_status_text', 'name','description','enabled', 'hpcService'], 'classes':['suit-tab suit-tab-general']})]
#, ('Content Providers', {'fields':['contentProviders'],'classes':['suit-tab suit-tab-cps']})]
readonly_fields = ('backend_status_text', )
@@ -121,6 +121,7 @@
verbose_name_plural = "Site Map"
list_display = ("backend_status_icon", "name", "contentProvider", "serviceProvider")
list_display_links = ('backend_status_icon', 'name', )
+ fields = ['backend_status_text', 'name', 'hpcService', 'contentProvider', 'serviceProvider', 'map', 'map_id']
user_readonly_fields = ('backend_status_text', "name", "contentProvider", "serviceProvider", "description", "map")
readonly_fields = ('backend_status_text', )
diff --git a/xos/hpc/models.py b/xos/hpc/models.py
index 8fc1885..30bbd49 100644
--- a/xos/hpc/models.py
+++ b/xos/hpc/models.py
@@ -7,16 +7,19 @@
# Create your models here.
-class HpcService(SingletonModel,Service):
+class HpcService(Service):
class Meta:
app_label = "hpc"
verbose_name = "HPC Service"
+ cmi_url = models.URLField(null=True, blank=True)
+
class ServiceProvider(PlCoreBase):
class Meta:
app_label = "hpc"
+ hpcService = models.ForeignKey(HpcService, null=True, blank=True)
service_provider_id = models.IntegerField(null=True, blank=True)
name = models.CharField(max_length=254,help_text="Service Provider Name")
description = models.TextField(max_length=254,null=True, blank=True, help_text="Description of Service Provider")
@@ -97,6 +100,7 @@
contentProvider = models.ForeignKey(ContentProvider, blank=True, null=True)
serviceProvider = models.ForeignKey(ServiceProvider, blank=True, null=True)
cdnPrefix = models.ForeignKey(CDNPrefix, blank = True, null=True)
+ hpcService = models.ForeignKey(HpcService, blank = True, null=True)
name = models.CharField(max_length=64, help_text="Name of the Site Map")
description = models.TextField(null=True, blank=True,max_length=130)
map = models.FileField(upload_to="maps/", help_text="specifies how to map requests to hpc instances")
@@ -105,9 +109,11 @@
def __unicode__(self): return self.name
def save(self, *args, **kwds):
- if (self.contentProvider) and (self.serviceProvider or self.cdnPrefix):
- raise ValueError("You may only set one of contentProvider, serviceProvider, or cdnPrefix")
- if (self.serviceProvider) and (self.cdnPrefix):
- raise ValueError("You may only set one of contentProvider, serviceProvider, or cdnPrefix")
+ if (self.contentProvider) and (self.serviceProvider or self.cdnPrefix or self.hpcService):
+ raise ValueError("You may only set one of contentProvider, serviceProvider, cdnPrefix, or hpcService")
+ if (self.serviceProvider) and (self.cdnPrefix or self.hpcService):
+ raise ValueError("You may only set one of contentProvider, serviceProvider, cdnPrefix, or hpcService")
+ if (self.cdnPrefix) and (self.hpcService):
+ raise ValueError("You may only set one of contentProvider, serviceProvider, cdnPrefix, or hpcService")
super(SiteMap, self).save(*args, **kwds)