summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-02-24 17:20:50 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-24 23:35:43 +0000
commite28097f8a23b324a7de8b58f8d5dc4ca8512e52a (patch)
treeb9daef7cd4ad4785c60f8128bca09e5a66037bbe /bitbake/lib/toaster
parentbd5087dc77881d7d171e28e10c21f2f2d05c1e95 (diff)
downloadpoky-e28097f8a23b324a7de8b58f8d5dc4ca8512e52a.tar.gz
bitbake: toaster: layerdetails summary/descriptions to be searchable
Allow the descriptions of the machine summary and layer description to be searchable in their respective tables. [YOCTO #7199] (Bitbake rev: 1a1a61f587e05af76299c7e1d3b7ab079fb4b1c1) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster')
-rw-r--r--bitbake/lib/toaster/toastergui/templates/layerdetails.html2
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py42
2 files changed, 26 insertions, 18 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/layerdetails.html b/bitbake/lib/toaster/toastergui/templates/layerdetails.html
index c162c8b95c..6c803ff544 100644
--- a/bitbake/lib/toaster/toastergui/templates/layerdetails.html
+++ b/bitbake/lib/toaster/toastergui/templates/layerdetails.html
@@ -257,7 +257,7 @@
257 <i class="icon-question-sign get-help" title="The recipe version and revision"></i> 257 <i class="icon-question-sign get-help" title="The recipe version and revision"></i>
258 Target version 258 Target version
259 </th> 259 </th>
260 <th class="span4">Description</th> 260 <th class="span4">Summary</th>
261 <th class="span2">Build target</th> 261 <th class="span2">Build target</th>
262 </tr> 262 </tr>
263 </thead> 263 </thead>
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index be74c10f6e..196e66ea1b 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -2622,31 +2622,39 @@ if toastermain.settings.MANAGED:
2622 2622
2623 layer_version = Layer_Version.objects.get(pk = layerid) 2623 layer_version = Layer_Version.objects.get(pk = layerid)
2624 2624
2625 targets_query = Recipe.objects.filter(layer_version=layer_version)
2626
2625 # Targets tab query functionality 2627 # Targets tab query functionality
2626 if request.GET.has_key('targets_search'): 2628 if request.GET.has_key('targets_search'):
2627 targets = Paginator(Recipe.objects.filter(layer_version=layer_version,name__icontains=request.GET['targets_search']).order_by("name"), limit) 2629 targets_query = targets_query.filter(
2628 else: 2630 Q(name__icontains=request.GET['targets_search']) |
2629 targets = Paginator(Recipe.objects.filter(layer_version=layer_version).order_by("name"), limit) 2631 Q(summary__icontains=request.GET['targets_search']))
2632
2633 targets = Paginator(targets_query.order_by("name"), limit)
2630 2634
2631 if request.GET.has_key("tpage"): 2635 if request.GET.has_key("tpage"):
2632 try: 2636 try:
2633 targets = targets.page(request.GET['tpage']) 2637 targets = targets.page(request.GET['tpage'])
2634 except EmptyPage: 2638 except EmptyPage:
2635 targets = targets.page(targets.num_pages) 2639 targets = targets.page(targets.num_pages)
2636 else: 2640 else:
2637 targets = targets.page(1) 2641 targets = targets.page(1)
2638 2642
2643 machines_query = Machine.objects.filter(layer_version=layer_version)
2644
2639 # Machines tab query functionality 2645 # Machines tab query functionality
2640 if request.GET.has_key('machines_search'): 2646 if request.GET.has_key('machines_search'):
2641 machines = Paginator(Machine.objects.filter(layer_version=layer_version,name__icontains=request.GET['machines_search']).order_by("name"), limit) 2647 machines_query = machines_query.filter(
2642 else: 2648 Q(name__icontains=request.GET['machines_search']) |
2643 machines = Paginator(Machine.objects.filter(layer_version=layer_version).order_by("name"), limit) 2649 Q(description__icontains=request.GET['machines_search']))
2650
2651 machines = Paginator(machines_query.order_by("name"), limit)
2644 2652
2645 if request.GET.has_key("mpage"): 2653 if request.GET.has_key("mpage"):
2646 try: 2654 try:
2647 machines = machines.page(request.GET['mpage']) 2655 machines = machines.page(request.GET['mpage'])
2648 except EmptyPage: 2656 except EmptyPage:
2649 machines = machines.page(machines.num_pages) 2657 machines = machines.page(machines.num_pages)
2650 else: 2658 else:
2651 machines = machines.page(1) 2659 machines = machines.page(1)
2652 2660
@@ -2787,9 +2795,9 @@ if toastermain.settings.MANAGED:
2787 # Now we need to weed out the layers which will appear as duplicated 2795 # Now we need to weed out the layers which will appear as duplicated
2788 # because they're from a layer source which doesn't need to be used 2796 # because they're from a layer source which doesn't need to be used
2789 for machine in queryset_all: 2797 for machine in queryset_all:
2790 to_rm = machine.layer_version.get_equivalents_wpriority(prj)[1:] 2798 to_rm = machine.layer_version.get_equivalents_wpriority(prj)[1:]
2791 if len(to_rm) > 0: 2799 if len(to_rm) > 0:
2792 queryset_all = queryset_all.exclude(layer_version__in=to_rm) 2800 queryset_all = queryset_all.exclude(layer_version__in=to_rm)
2793 2801
2794 machine_info = _build_page_range(Paginator(queryset_all, request.GET.get('count', 100)),request.GET.get('page', 1)) 2802 machine_info = _build_page_range(Paginator(queryset_all, request.GET.get('count', 100)),request.GET.get('page', 1))
2795 2803