diff options
author | Michael Wood <michael.g.wood@intel.com> | 2015-09-29 10:50:10 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-09-29 13:45:06 +0100 |
commit | 505979ab931e3a2a218d7030d6064987e8f9ff14 (patch) | |
tree | 4d5551e5ef3e339d560b55ed4574b0517bc55262 /lib/toaster/toastergui | |
parent | 46b119eb62a5a612fe4c0847862d34f408e556f7 (diff) | |
download | bitbake-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')
-rw-r--r-- | lib/toaster/toastergui/tables.py | 2 | ||||
-rw-r--r-- | lib/toaster/toastergui/typeaheads.py | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/toaster/toastergui/tables.py b/lib/toaster/toastergui/tables.py index 3354072e1..5cc04a237 100644 --- a/lib/toaster/toastergui/tables.py +++ b/lib/toaster/toastergui/tables.py @@ -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", 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) |