diff options
| author | Michael Wood <michael.g.wood@intel.com> | 2015-08-04 22:46:31 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-06 16:04:44 -0500 |
| commit | 68128ad2f1ab2004e64511c2ce9162cdfa6a9cb5 (patch) | |
| tree | f0c2fc35d150b4bb1751afa57f324552f596987d | |
| parent | c4e7113dd09c11a8a661cbefc417fcfbc5d5f6af (diff) | |
| download | poky-68128ad2f1ab2004e64511c2ce9162cdfa6a9cb5.tar.gz | |
bitbake: toastergui: tables Use util functions for the common querysets
Use the new utils functions on the project object to get the common querysets
that we also use in tables.
(Bitbake rev: 5e013a9bc3deb03bd6bac357b9ecb81c3c77b255)
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | bitbake/lib/toaster/toastergui/tables.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py index 8d5166be55..e4cbec193e 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py | |||
| @@ -251,9 +251,8 @@ class MachinesTable(ToasterTable, ProjectFiltersMixin): | |||
| 251 | 251 | ||
| 252 | def setup_queryset(self, *args, **kwargs): | 252 | def setup_queryset(self, *args, **kwargs): |
| 253 | prj = Project.objects.get(pk = kwargs['pid']) | 253 | prj = Project.objects.get(pk = kwargs['pid']) |
| 254 | compatible_layers = prj.compatible_layerversions() | 254 | self.queryset = prj.get_all_compatible_machines() |
| 255 | 255 | self.queryset = self.queryset.order_by(self.default_orderby) | |
| 256 | self.queryset = Machine.objects.filter(layer_version__in=compatible_layers).order_by(self.default_orderby) | ||
| 257 | 256 | ||
| 258 | def setup_columns(self, *args, **kwargs): | 257 | def setup_columns(self, *args, **kwargs): |
| 259 | 258 | ||
| @@ -363,11 +362,7 @@ class RecipesTable(ToasterTable, ProjectFiltersMixin): | |||
| 363 | def setup_queryset(self, *args, **kwargs): | 362 | def setup_queryset(self, *args, **kwargs): |
| 364 | prj = Project.objects.get(pk = kwargs['pid']) | 363 | prj = Project.objects.get(pk = kwargs['pid']) |
| 365 | 364 | ||
| 366 | self.queryset = Recipe.objects.filter(layer_version__in = prj.compatible_layerversions()) | 365 | self.queryset = prj.get_all_compatible_recipes() |
| 367 | |||
| 368 | search_maxids = map(lambda i: i[0], list(self.queryset.values('name').distinct().annotate(max_id=Max('id')).values_list('max_id'))) | ||
| 369 | |||
| 370 | self.queryset = self.queryset.filter(id__in=search_maxids).select_related('layer_version', 'layer_version__layer', 'layer_version__up_branch', 'layer_source') | ||
| 371 | self.queryset = self.queryset.order_by(self.default_orderby) | 366 | self.queryset = self.queryset.order_by(self.default_orderby) |
| 372 | 367 | ||
| 373 | 368 | ||
