summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-12-08 19:52:42 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-10 13:29:19 +0000
commit70a078ee851b0408b68ddc13fbc7fbb658ce38df (patch)
tree4a4d24b60ad3b30054982c5842ffd3ac830cc849 /bitbake/lib/toaster
parent7e4c231ca2a1a2dbc905945ba8bab0476c109bbb (diff)
downloadpoky-70a078ee851b0408b68ddc13fbc7fbb658ce38df.tar.gz
bitbake: toaster: tables SelectPackagesTable rename recipe_id to custrecipeid
Rename the recipe_id to custrecipeid to avoid confusion about which type of object we're going to be accessing. This means that in the unit tests for tables we can pass a different kwargs for custom recipes vs normal recipes. (Bitbake rev: ae3301a1047b3efb4b340b50a10d5d585b7333da) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster')
-rw-r--r--bitbake/lib/toaster/toastergui/tables.py12
-rw-r--r--bitbake/lib/toaster/toastergui/urls.py4
2 files changed, 10 insertions, 6 deletions
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py
index 48829351b4..d80b90254a 100644
--- a/bitbake/lib/toaster/toastergui/tables.py
+++ b/bitbake/lib/toaster/toastergui/tables.py
@@ -728,7 +728,8 @@ class SelectPackagesTable(PackagesTable):
728 self.title = "Add | Remove packages" 728 self.title = "Add | Remove packages"
729 729
730 def setup_queryset(self, *args, **kwargs): 730 def setup_queryset(self, *args, **kwargs):
731 cust_recipe = CustomImageRecipe.objects.get(pk=kwargs['recipeid']) 731 self.cust_recipe =\
732 CustomImageRecipe.objects.get(pk=kwargs['custrecipeid'])
732 prj = Project.objects.get(pk = kwargs['pid']) 733 prj = Project.objects.get(pk = kwargs['pid'])
733 734
734 current_packages = self.cust_recipe.get_all_packages() 735 current_packages = self.cust_recipe.get_all_packages()
@@ -747,13 +748,16 @@ class SelectPackagesTable(PackagesTable):
747 748
748 self.queryset = self.queryset.order_by('name') 749 self.queryset = self.queryset.order_by('name')
749 750
750 self.static_context_extra['recipe_id'] = kwargs['recipeid'] 751 self.static_context_extra['recipe_id'] = kwargs['custrecipeid']
751 self.static_context_extra['current_packages'] = \ 752 self.static_context_extra['current_packages'] = \
752 cust_recipe.packages.values_list('pk', flat=True) 753 current_packages.values_list('pk', flat=True)
753 754
754 def get_context_data(self, **kwargs): 755 def get_context_data(self, **kwargs):
756 # to reuse the Super class map the custrecipeid to the recipe_id
757 kwargs['recipe_id'] = kwargs['custrecipeid']
755 context = super(SelectPackagesTable, self).get_context_data(**kwargs) 758 context = super(SelectPackagesTable, self).get_context_data(**kwargs)
756 custom_recipe = CustomImageRecipe.objects.get(pk=kwargs['recipe_id']) 759 custom_recipe = \
760 CustomImageRecipe.objects.get(pk=kwargs['custrecipeid'])
757 761
758 context['recipe'] = custom_recipe 762 context['recipe'] = custom_recipe
759 context['approx_pkg_size'] = \ 763 context['approx_pkg_size'] = \
diff --git a/bitbake/lib/toaster/toastergui/urls.py b/bitbake/lib/toaster/toastergui/urls.py
index 969a29b228..4feeebc14a 100644
--- a/bitbake/lib/toaster/toastergui/urls.py
+++ b/bitbake/lib/toaster/toastergui/urls.py
@@ -129,11 +129,11 @@ urlpatterns = patterns('toastergui.views',
129 name=tables.LayerMachinesTable.__name__.lower()), 129 name=tables.LayerMachinesTable.__name__.lower()),
130 130
131 131
132 url(r'^project/(?P<pid>\d+)/customrecipe/(?P<recipeid>\d+)/selectpackages/$', 132 url(r'^project/(?P<pid>\d+)/customrecipe/(?P<custrecipeid>\d+)/selectpackages/$',
133 tables.SelectPackagesTable.as_view(), name="recipeselectpackages"), 133 tables.SelectPackagesTable.as_view(), name="recipeselectpackages"),
134 134
135 135
136 url(r'^project/(?P<pid>\d+)/customrecipe/(?P<recipe_id>\d+)$', 136 url(r'^project/(?P<pid>\d+)/customrecipe/(?P<custrecipeid>\d+)$',
137 tables.SelectPackagesTable.as_view(template_name="customrecipe.html"), 137 tables.SelectPackagesTable.as_view(template_name="customrecipe.html"),
138 name="customrecipe"), 138 name="customrecipe"),
139 139