add subscriber_service to ONOSApp admin
diff --git a/xos/services/onos/admin.py b/xos/services/onos/admin.py
index d5696b4..d13a991 100644
--- a/xos/services/onos/admin.py
+++ b/xos/services/onos/admin.py
@@ -95,7 +95,7 @@
class ONOSAppAdmin(ReadOnlyAwareAdmin):
list_display = ('backend_status_icon', 'name', )
list_display_links = ('backend_status_icon', 'name')
- fieldsets = [ (None, {'fields': ['backend_status_text', 'kind', 'name', 'provider_service', 'service_specific_attribute', "dependencies",
+ fieldsets = [ (None, {'fields': ['backend_status_text', 'kind', 'name', 'provider_service', 'subscriber_service', 'service_specific_attribute', "dependencies",
'creator'],
'classes':['suit-tab suit-tab-general']})]
readonly_fields = ('backend_status_text', 'instance', 'service_specific_attribute')
diff --git a/xos/services/onos/models.py b/xos/services/onos/models.py
index 8ed3618..80e903e 100644
--- a/xos/services/onos/models.py
+++ b/xos/services/onos/models.py
@@ -38,7 +38,7 @@
KIND = ONOS_KIND
default_attributes = {"name": "",
- "dependencies": "",}
+ "dependencies": ""}
def __init__(self, *args, **kwargs):
onos_services = ONOSService.get_service_objects().all()
if onos_services:
@@ -84,6 +84,19 @@
def dependencies(self, value):
self.set_attribute("dependencies", value)
+ #@property
+ #def instance(self):
+ # instance_id = self.get_attribute("instance_id", self.default_attributes["instance_id"])
+ # if instance_id:
+ # instances = Instance.objects.filter(id=instance_id)
+ # if instances:
+ # return instances[0]
+ # return None
+
+ #@instance.setter
+ #def instance(self, value):
+ # self.set_attribute("instance_id", value.id)
+
def save(self, *args, **kwargs):
if not self.creator:
if not getattr(self, "caller", None):