aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2016-01-18 14:51:54 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-10 13:29:20 +0000
commitbaac4589ae20b425f9afce1488cbd0d54bb36421 (patch)
tree3fbdfd0b3eca9378501278d28495778b29f34d1c /bitbake
parentefbffe3c298d57af34324639f2208e35735758a9 (diff)
downloadopenembedded-core-contrib-baac4589ae20b425f9afce1488cbd0d54bb36421.tar.gz
bitbake: toaster: update custom image package table filters
The custom image package selection filters were using the old ToasterTable filter approach, which caused the table filter to fail. Amend the table to use the new ToasterTable filtering API to fix this. (Bitbake rev: 72a4cb30842fd053e46dc56df222729cbe735162) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/toastergui/tables.py46
1 files changed, 20 insertions, 26 deletions
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py
index 7fb3f8605e..2903a81696 100644
--- a/bitbake/lib/toaster/toastergui/tables.py
+++ b/bitbake/lib/toaster/toastergui/tables.py
@@ -773,38 +773,32 @@ class SelectPackagesTable(PackagesTable):
self.add_column(title="Add | Remove",
hideable=False,
help_text="Use the add and remove buttons to modify "
- "the package content of you custom image",
+ "the package content of your custom image",
static_data_name="add_rm_pkg_btn",
static_data_template='{% include "pkg_add_rm_btn.html" %}',
- filter_name="in_current_image"
- )
+ filter_name='in_current_image_filter')
def setup_filters(self, *args, **kwargs):
- project = Project.objects.get(pk=kwargs['pid'])
- self.project_layers = ProjectLayer.objects.filter(project=project)
+ in_current_image_filter = TableFilter(
+ 'in_current_image_filter',
+ 'Filter by added packages'
+ )
+ in_image_action = TableFilterActionToggle(
+ 'in_image',
+ 'Packages in %s' % self.cust_recipe.name,
+ Q(pk__in=self.static_context_extra['current_packages'])
+ )
+
+ not_in_image_action = TableFilterActionToggle(
+ 'not_in_image',
+ 'Packages not added to %s' % self.cust_recipe.name,
+ ~Q(pk__in=self.static_context_extra['current_packages'])
+ )
- self.add_filter(title="Filter by added packages",
- name="in_current_image",
- filter_actions=[
- self.make_filter_action(
- "in_image",
- "Packages in %s" % self.cust_recipe.name,
- self.filter_in_image),
- self.make_filter_action(
- "not_in_image",
- "Packages not added to %s" %
- self.cust_recipe.name,
- self.filter_not_in_image)
- ])
-
- def filter_in_image(self):
- return self.queryset.filter(
- pk__in=self.static_context_extra['current_packages'])
-
- def filter_not_in_image(self):
- return self.queryset.exclude(
- pk__in=self.static_context_extra['current_packages'])
+ in_current_image_filter.add_action(in_image_action)
+ in_current_image_filter.add_action(not_in_image_action)
+ self.add_filter(in_current_image_filter)
class ProjectsTable(ToasterTable):
"""Table of projects in Toaster"""