diff options
| author | Michael Wood <michael.g.wood@intel.com> | 2015-12-08 19:52:42 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-10 13:29:19 +0000 |
| commit | 70a078ee851b0408b68ddc13fbc7fbb658ce38df (patch) | |
| tree | 4a4d24b60ad3b30054982c5842ffd3ac830cc849 /bitbake/lib/toaster/toastergui/tables.py | |
| parent | 7e4c231ca2a1a2dbc905945ba8bab0476c109bbb (diff) | |
| download | poky-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/toastergui/tables.py')
| -rw-r--r-- | bitbake/lib/toaster/toastergui/tables.py | 12 |
1 files changed, 8 insertions, 4 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'] = \ |
