summaryrefslogtreecommitdiffstats
path: root/lib/toaster/toastergui/typeaheads.py
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-09-29 10:50:10 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-29 13:45:06 +0100
commit505979ab931e3a2a218d7030d6064987e8f9ff14 (patch)
tree4d5551e5ef3e339d560b55ed4574b0517bc55262 /lib/toaster/toastergui/typeaheads.py
parent46b119eb62a5a612fe4c0847862d34f408e556f7 (diff)
downloadbitbake-contrib-505979ab931e3a2a218d7030d6064987e8f9ff14.tar.gz
toaster: orm remove the complicated querying on the ORM
We no longer need to compute each layer_version and all the recipes which belong to this. [YOCTO #8147] Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/toaster/toastergui/typeaheads.py')
-rw-r--r--lib/toaster/toastergui/typeaheads.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/toaster/toastergui/typeaheads.py b/lib/toaster/toastergui/typeaheads.py
index d5bec58ea..9db31827b 100644
--- a/lib/toaster/toastergui/typeaheads.py
+++ b/lib/toaster/toastergui/typeaheads.py
@@ -27,7 +27,7 @@ class LayersTypeAhead(ToasterTypeAhead):
super(LayersTypeAhead, self).__init__()
def apply_search(self, search_term, prj, request):
- layers = prj.compatible_layerversions()
+ layers = prj.get_all_compatible_layer_versions()
layers = layers.order_by('layer__name')
# Unlike the other typeaheads we also don't want to show suggestions
@@ -35,7 +35,8 @@ class LayersTypeAhead(ToasterTypeAhead):
# layerdeps to a new layer.
if ("include_added" in request.GET and
request.GET['include_added'] != "true"):
- layers = layers.exclude(pk__in=prj.projectlayer_equivalent_set)
+ layers = layers.exclude(
+ pk__in=prj.get_project_layer_versions(pk=True))
primary_results = layers.filter(layer__name__istartswith=search_term)
secondary_results = layers.filter(layer__name__icontains=search_term).exclude(pk__in=primary_results)