diff options
| author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2015-06-08 18:33:44 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-06-12 00:01:49 +0100 |
| commit | 58cd4a14ea81b72dcd9679608e5e2231ec3d3631 (patch) | |
| tree | 15cea3afb06ad5ae448fbf2fb65bfb4cb7535308 /bitbake/lib/toaster/toastergui/tables.py | |
| parent | 27f5137cd6143b523e9aea8eeba406337aa935c4 (diff) | |
| download | poky-58cd4a14ea81b72dcd9679608e5e2231ec3d3631.tar.gz | |
bitbake: toaster: fixes after refactoring
This patch fixes issues brought in by refactoring:
* the New Build button is working with pre-set projects
* the xhr_datatypeahead is exposed for calls that are not
mapable to the REST objects
* a new table returing recipes provided by layers currently
selected in the project is used to provide recipe suggestions
* the field names in json are switched from "list" to "rows" as
to maintain consistency with the ToasterTables
* the "value" field in xhr_ calls is now named "search" to maintain
consistency
(Bitbake rev: a5bc29083d4f85a5695f3f62d5badb783c6f7224)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.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 | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py index 003b924d00..b85527e216 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py | |||
| @@ -287,7 +287,7 @@ class RecipesTable(ToasterTable): | |||
| 287 | def setup_queryset(self, *args, **kwargs): | 287 | def setup_queryset(self, *args, **kwargs): |
| 288 | prj = Project.objects.get(pk = kwargs['pid']) | 288 | prj = Project.objects.get(pk = kwargs['pid']) |
| 289 | 289 | ||
| 290 | self.queryset = Recipe.objects.filter(Q(layer_version__up_branch__name= prj.release.name) | Q(layer_version__build__in = prj.build_set.all())).filter(name__regex=r'.{1,}.*') | 290 | self.queryset = Recipe.objects.filter(layer_version__in = prj.compatible_layerversions()) |
| 291 | 291 | ||
| 292 | search_maxids = map(lambda i: i[0], list(self.queryset.values('name').distinct().annotate(max_id=Max('id')).values_list('max_id'))) | 292 | search_maxids = map(lambda i: i[0], list(self.queryset.values('name').distinct().annotate(max_id=Max('id')).values_list('max_id'))) |
| 293 | 293 | ||
| @@ -392,3 +392,11 @@ class LayerRecipesTable(RecipesTable): | |||
| 392 | self.add_column(title="Build recipe", | 392 | self.add_column(title="Build recipe", |
| 393 | static_data_name="add-del-layers", | 393 | static_data_name="add-del-layers", |
| 394 | static_data_template=build_recipe_template) | 394 | static_data_template=build_recipe_template) |
| 395 | |||
| 396 | class ProjectLayersRecipesTable(RecipesTable): | ||
| 397 | """ Table that lists only recipes available for layers added to the project """ | ||
| 398 | |||
| 399 | def setup_queryset(self, *args, **kwargs): | ||
| 400 | super(ProjectLayersRecipesTable, self).setup_queryset(*args, **kwargs) | ||
| 401 | prj = Project.objects.get(pk = kwargs['pid']) | ||
| 402 | self.queryset = self.queryset.filter(layer_version__in = prj.projectlayer_equivalent_set()) | ||
