diff options
| -rw-r--r-- | bitbake/lib/toaster/toastergui/tables.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py index a676ffa98b..4f24772206 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py | |||
| @@ -335,10 +335,23 @@ class RecipesTable(ToasterTable, ProjectFiltersMixin): | |||
| 335 | 335 | ||
| 336 | return context | 336 | return context |
| 337 | 337 | ||
| 338 | def setup_filters(self, *args, **kwargs): | ||
| 339 | self.add_filter(title="Filter by project recipes", | ||
| 340 | name="in_current_project", | ||
| 341 | filter_actions=[ | ||
| 342 | self.make_filter_action("in_project", "Recipes provided by layers added to this project", self.filter_in_project), | ||
| 343 | self.make_filter_action("not_in_project", "Recipes provided by layers not added to this project", self.filter_not_in_project) | ||
| 344 | ]) | ||
| 338 | 345 | ||
| 339 | def setup_queryset(self, *args, **kwargs): | 346 | def setup_queryset(self, *args, **kwargs): |
| 340 | prj = Project.objects.get(pk = kwargs['pid']) | 347 | prj = Project.objects.get(pk = kwargs['pid']) |
| 341 | 348 | ||
| 349 | # Project layers used by the filters | ||
| 350 | self.project_layers = prj.get_project_layer_versions(pk=True) | ||
| 351 | |||
| 352 | # Project layers used to switch the button states | ||
| 353 | self.static_context_extra['current_layers'] = self.project_layers | ||
| 354 | |||
| 342 | self.queryset = prj.get_all_compatible_recipes() | 355 | self.queryset = prj.get_all_compatible_recipes() |
| 343 | self.queryset = self.queryset.order_by(self.default_orderby) | 356 | self.queryset = self.queryset.order_by(self.default_orderby) |
| 344 | 357 | ||
