add TenantAttribute model
diff --git a/xos/core/admin.py b/xos/core/admin.py
index b3dc67d..5d2996a 100644
--- a/xos/core/admin.py
+++ b/xos/core/admin.py
@@ -787,6 +787,23 @@
return tabs
+class TenantAttributeAdmin(XOSBaseAdmin):
+ model = TenantAttribute
+ list_display = ('backend_status_icon', 'tenant', 'name', 'value')
+ list_display_links = ('backend_status_icon', 'name')
+ fieldList = ('backend_status_text', 'tenant', 'name', 'value', )
+ fieldsets = [(None, {'fields': fieldList, 'classes':['suit-tab suit-tab-general']})]
+ readonly_fields = ('backend_status_text', )
+
+ suit_form_tabs =(('general', 'Tenant Root Details'),
+ )
+
+class TenantAttrAsTabInline(XOSTabularInline):
+ model = TenantAttribute
+ fields = ['name','value']
+ extra = 0
+ suit_classes = 'suit-tab suit-tab-tenantattrs'
+
class TenantRootRoleAdmin(XOSBaseAdmin):
model = TenantRootRole
fields = ('role',)
@@ -2006,4 +2023,5 @@
admin.site.register(Flavor, FlavorAdmin)
admin.site.register(TenantRoot, TenantRootAdmin)
admin.site.register(TenantRootRole, TenantRootRoleAdmin)
+ admin.site.register(TenantAttribute, TenantAttributeAdmin)
diff --git a/xos/core/models/__init__.py b/xos/core/models/__init__.py
index ad271a4..c380e9c 100644
--- a/xos/core/models/__init__.py
+++ b/xos/core/models/__init__.py
@@ -2,7 +2,7 @@
from .project import Project
from .singletonmodel import SingletonModel
from .service import Service, Tenant, TenantWithContainer, CoarseTenant, ServicePrivilege, TenantRoot, TenantRootPrivilege, TenantRootRole, Subscriber, Provider
-from .service import ServiceAttribute
+from .service import ServiceAttribute, TenantAttribute
from .tag import Tag
from .role import Role
from .site import Site, Deployment, DeploymentRole, DeploymentPrivilege, Controller, ControllerRole, ControllerSite, SiteDeployment
diff --git a/xos/core/models/service.py b/xos/core/models/service.py
index 9530c72..8d2180c 100644
--- a/xos/core/models/service.py
+++ b/xos/core/models/service.py
@@ -488,6 +488,11 @@
KIND = "Provider"
+class TenantAttribute(PlCoreBase):
+ name = models.SlugField(help_text="Attribute Name", max_length=128)
+ value = models.TextField(help_text="Attribute Value")
+ tenant = models.ForeignKey(Tenant, related_name='tenantattributes', help_text="The Tenant this attribute is associated with")
+
class TenantRootRole(PlCoreBase):
ROLE_CHOICES = (('admin','Admin'), ('access','Access'))