Renamed SliceDeployment back to SliceDeployments
diff --git a/planetstack/core/admin.py b/planetstack/core/admin.py
index 84b2892..de766fc 100644
--- a/planetstack/core/admin.py
+++ b/planetstack/core/admin.py
@@ -422,8 +422,8 @@
def queryset(self, request):
return SitePrivilege.select_by_user(request.user)
-class SiteDeploymentInline(PlStackTabularInline):
- model = SiteDeployment
+class SiteDeploymentsInline(PlStackTabularInline):
+ model = SiteDeployments
extra = 0
suit_classes = 'suit-tab suit-tab-deployments'
fields = ['backend_status_icon', 'deployment','site']
@@ -435,10 +435,10 @@
if db_field.name == 'deployment':
kwargs['queryset'] = Deployment.select_by_user(request.user)
- return super(SiteDeploymentInline, self).formfield_for_foreignkey(db_field, request, **kwargs)
+ return super(SiteDeploymentsInline, self).formfield_for_foreignkey(db_field, request, **kwargs)
def queryset(self, request):
- return SiteDeployment.select_by_user(request.user)
+ return SiteDeployments.select_by_user(request.user)
class SlicePrivilegeInline(PlStackTabularInline):
@@ -574,7 +574,7 @@
# create/destroy the through models ourselves. There has to be
# a better way...
- self.manipulate_m2m_objs(deployment, self.cleaned_data['sites'], deployment.sitedeployments.all(), SiteDeployment, "deployment", "site")
+ self.manipulate_m2m_objs(deployment, self.cleaned_data['sites'], deployment.sitedeployments.all(), SiteDeployments, "deployment", "site")
self.manipulate_m2m_objs(deployment, self.cleaned_data['images'], deployment.imagedeployments.all(), ImageDeployment, "deployment", "image")
self.save_m2m()
@@ -661,7 +661,7 @@
list_display = ('backend_status_icon', 'name', 'login_base','site_url', 'enabled')
list_display_links = ('backend_status_icon', 'name', )
filter_horizontal = ('deployments',)
- inlines = [SliceInline,UserInline,TagInline, NodeInline, SitePrivilegeInline, SiteDeploymentInline]
+ inlines = [SliceInline,UserInline,TagInline, NodeInline, SitePrivilegeInline, SiteDeploymentsInline]
search_fields = ['name']
def queryset(self, request):
diff --git a/planetstack/core/models/__init__.py b/planetstack/core/models/__init__.py
index 821939e..09f4749 100644
--- a/planetstack/core/models/__init__.py
+++ b/planetstack/core/models/__init__.py
@@ -5,13 +5,13 @@
from .service import ServiceAttribute
from .tag import Tag
from .role import Role
-from .site import Site,Deployment, DeploymentRole, DeploymentPrivilege, SiteDeployment
+from .site import Site,Deployment, DeploymentRole, DeploymentPrivilege, SiteDeployments
from .dashboard import DashboardView
from .user import User, UserDashboardView
from .serviceclass import ServiceClass
from .site import DeploymentLinkManager,DeploymentLinkDeletionManager
from .slice import Slice, SliceDeployment
-from .site import SitePrivilege, SiteDeployment
+from .site import SitePrivilege, SiteDeployments
from .userdeployments import UserDeployment
from .image import Image, ImageDeployment
from .node import Node
diff --git a/planetstack/core/models/site.py b/planetstack/core/models/site.py
index 09eb786..2404e34 100644
--- a/planetstack/core/models/site.py
+++ b/planetstack/core/models/site.py
@@ -105,7 +105,7 @@
abbreviated_name = models.CharField(max_length=80)
#deployments = models.ManyToManyField('Deployment', blank=True, related_name='sites')
- deployments = models.ManyToManyField('Deployment', through='SiteDeployment', blank=True, help_text="Select which sites are allowed to host nodes in this deployment", related_name='sites')
+ deployments = models.ManyToManyField('Deployment', through='SiteDeployments', blank=True, help_text="Select which sites are allowed to host nodes in this deployment", related_name='sites')
tags = generic.GenericRelation(Tag)
def __unicode__(self): return u'%s' % (self.name)
@@ -255,7 +255,7 @@
qs = DeploymentPrivilege.objects.filter(id__in=dpriv_ids)
return qs
-class SiteDeployment(PlCoreBase):
+class SiteDeployments(PlCoreBase):
objects = DeploymentLinkManager()
deleted_objects = DeploymentLinkDeletionManager()