From c337d32fe0372701ccd90d8212b21b88804ce351 Mon Sep 17 00:00:00 2001 From: Scott Baker Date: Wed, 21 Jan 2015 16:24:07 -0800 Subject: [PATCH] fix filter code in sliver inline --- planetstack/core/admin.py | 2 +- planetstack/templates/admin/core/slice/change_form.html | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/planetstack/core/admin.py b/planetstack/core/admin.py index 054871f..8748ed1 100644 --- a/planetstack/core/admin.py +++ b/planetstack/core/admin.py @@ -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(): diff --git a/planetstack/templates/admin/core/slice/change_form.html b/planetstack/templates/admin/core/slice/change_form.html index 31f09c0..6800dfd 100644 --- a/planetstack/templates/admin/core/slice/change_form.html +++ b/planetstack/templates/admin/core/slice/change_form.html @@ -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); -- 2.43.0