1
0
mirror of https://git.yoctoproject.org/poky synced 2026-07-17 04:07:06 +00:00

bitbake: 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]

(Bitbake rev: 505979ab931e3a2a218d7030d6064987e8f9ff14)

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>
This commit is contained in:
Michael Wood
2015-09-29 10:50:10 +01:00
committed by Richard Purdie
parent fe29297c6a
commit f902dc646d
3 changed files with 34 additions and 22 deletions
+1 -1
View File
@@ -221,7 +221,7 @@ class MachinesTable(ToasterTable, ProjectFiltersMixin):
def setup_filters(self, *args, **kwargs):
project = Project.objects.get(pk=kwargs['pid'])
self.project_layers = project.projectlayer_equivalent_set()
self.project_layers = project.get_project_layer_versions()
self.add_filter(title="Filter by project machines",
name="in_current_project",
+3 -2
View File
@@ -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)