diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui')
-rw-r--r-- | bitbake/lib/toaster/toastergui/tables.py | 12 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/urls.py | 4 |
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 | ||