summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/orm
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-06-08 18:33:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-12 00:01:49 +0100
commit58cd4a14ea81b72dcd9679608e5e2231ec3d3631 (patch)
tree15cea3afb06ad5ae448fbf2fb65bfb4cb7535308 /bitbake/lib/toaster/orm
parent27f5137cd6143b523e9aea8eeba406337aa935c4 (diff)
downloadpoky-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/orm')
-rw-r--r--bitbake/lib/toaster/orm/models.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 8e73ee1afd..88194504c5 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -180,13 +180,12 @@ class Project(models.Model):
180 queryset = queryset.filter(layer__name = layer_name) 180 queryset = queryset.filter(layer__name = layer_name)
181 181
182 # order by layer version priority 182 # order by layer version priority
183 queryset = queryset.filter(Q(layer_source=None) | Q(layer_source__releaselayersourcepriority__release = release)).select_related('layer_source', 'layer', 'up_branch').annotate(prio=Avg("layer_source__releaselayersourcepriority__priority")).order_by("-prio") 183 queryset = queryset.filter(Q(layer_source=None) | Q(layer_source__releaselayersourcepriority__release = release)).select_related('layer_source', 'layer', 'up_branch', "layer_source__releaselayersourcepriority__priority").order_by("-layer_source__releaselayersourcepriority__priority")
184 184
185 return queryset 185 return queryset
186 186
187 # returns a set of layer-equivalent set of layers already in project
188 def projectlayer_equivalent_set(self): 187 def projectlayer_equivalent_set(self):
189 return [j for i in [x.layercommit.get_equivalents_wpriority(self) for x in self.projectlayer_set.all().select_related("up_branch")] for j in i] 188 return self.compatible_layerversions().filter(layer__name__in = [x.layercommit.layer.name for x in self.projectlayer_set.all()]).select_related("up_branch")
190 189
191 def schedule_build(self): 190 def schedule_build(self):
192 from bldcontrol.models import BuildRequest, BRTarget, BRLayer, BRVariable, BRBitbake 191 from bldcontrol.models import BuildRequest, BRTarget, BRLayer, BRVariable, BRBitbake