fix filter code in sliver inline
authorScott Baker <smbaker@gmail.com>
Thu, 22 Jan 2015 00:24:07 +0000 (16:24 -0800)
committerScott Baker <smbaker@gmail.com>
Thu, 22 Jan 2015 00:24:07 +0000 (16:24 -0800)
planetstack/core/admin.py
planetstack/templates/admin/core/slice/change_form.html

index 054871f..8748ed1 100644 (file)
@@ -958,7 +958,7 @@ class SliceAdmin(PlanetStackBaseAdmin):
     def render_change_form(self, request, context, add=False, change=False, form_url='', obj=None):
         deployment_nodes = []
         for node in Node.objects.all():
-            deployment_nodes.append( (node.site_deployment.id, node.id, node.name) )
+            deployment_nodes.append( (node.site_deployment.deployment.id, node.id, node.name) )
 
         deployment_flavors = []
         for flavor in Flavor.objects.all():
index 31f09c0..6800dfd 100644 (file)
@@ -86,19 +86,19 @@ function update_images(deployment_select, image_select) {
 }
 
 function sliver_deployment_changed(any_control) {
-   /* This function handles someone changing the deploymentNetwork control
+   /* This function handles someone changing the deployment control
       in the add-sliver line. It updats the flavors and nodes dialogs
       accordingly.
    */
 
    /* the inscrutable jquery selector below says:
       find the closest parent "tr" to the current element
-      then find the child with class "field-deploymentNetwork"
+      then find the child with class "field-deployment"
       then find the child with that is a select
       then return it's id
       then turn it into a jquery object
     */
-    deployment_select = $("#" + $($(any_control).closest('tr')[0]).find('.field-deploymentNetwork select')[0].id);
+    deployment_select = $("#" + $($(any_control).closest('tr')[0]).find('.field-deployment select')[0].id);
     node_select = $("#" + $($(any_control).closest('tr')[0]).find('.field-node select')[0].id);
     flavor_select = $("#" + $($(any_control).closest('tr')[0]).find('.field-flavor select')[0].id);
     image_select = $("#" + $($(any_control).closest('tr')[0]).find('.field-image select')[0].id);
@@ -111,7 +111,7 @@ function sliver_flavor_changed(any_control) {
     /* this is like sliver_flavor changed, but does not update the flavors
        control
     */
-    deployment_select = $("#" + $($(any_control).closest('tr')[0]).find('.field-deploymentNetwork select')[0].id);
+    deployment_select = $("#" + $($(any_control).closest('tr')[0]).find('.field-deployment select')[0].id);
     node_select = $("#" + $($(any_control).closest('tr')[0]).find('.field-node select')[0].id);
     flavor_select = $("#" + $($(any_control).closest('tr')[0]).find('.field-flavor select')[0].id);
     update_nodes(deployment_select, flavor_select, node_select);