summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-02-12 15:45:52 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-17 14:38:32 +0000
commitbaa38a14c7d3a71b650b6362641bddbe7aaa3315 (patch)
tree6367b4c2200811f7ac2abfb5ed70433ed3782286 /bitbake
parentc5ba5eccba58f8480e028eec729c5f67834066ac (diff)
downloadpoky-baa38a14c7d3a71b650b6362641bddbe7aaa3315.tar.gz
bitbake: toaster: Remove filtering from layers,machines and targets
The filter counts are unreliable so for consistency the filter feature here is removed. [YOCTO #7060] [YOCTO #7052] (Bitbake rev: ca5124d48d306921ac0f0499762ea5867644b0ef) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py61
1 files changed, 2 insertions, 59 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 7bfedb46b1..1553c7475e 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -2554,7 +2554,6 @@ if toastermain.settings.MANAGED:
2554 'objects' : layer_info, 2554 'objects' : layer_info,
2555 'objectname' : "layers", 2555 'objectname' : "layers",
2556 'default_orderby' : 'layer__name:+', 2556 'default_orderby' : 'layer__name:+',
2557 'total_count': len(object_list),
2558 2557
2559 'tablecols' : [ 2558 'tablecols' : [
2560 { 'name': 'Layer', 2559 { 'name': 'Layer',
@@ -2586,15 +2585,6 @@ if toastermain.settings.MANAGED:
2586 { 'name': 'Add | Delete', 2585 { 'name': 'Add | Delete',
2587 'dclass': 'span2', 2586 'dclass': 'span2',
2588 'qhelp': "Add or delete layers to / from your project ", 2587 'qhelp': "Add or delete layers to / from your project ",
2589 'filter': {
2590 'class': 'add-del-layers',
2591 'label': 'Show:',
2592 'options': [
2593 ('Layers added to this project', "projectlayer__project:" + str(prj.id), queryset_all.filter(projectlayer__project = prj.id).count()),
2594 ('Layers not added to this project', "projectlayer__project:NOT" + str(prj.id), queryset_all.exclude(projectlayer__project = prj.id).count()),
2595 ]
2596
2597 }
2598 }, 2588 },
2599 ] 2589 ]
2600 } 2590 }
@@ -2690,7 +2680,6 @@ if toastermain.settings.MANAGED:
2690 'objects' : target_info, 2680 'objects' : target_info,
2691 'objectname' : "targets", 2681 'objectname' : "targets",
2692 'default_orderby' : 'name:+', 2682 'default_orderby' : 'name:+',
2693 'total_count': queryset_with_search.count(),
2694 2683
2695 'tablecols' : [ 2684 'tablecols' : [
2696 { 'name': 'Target', 2685 { 'name': 'Target',
@@ -2742,15 +2731,6 @@ if toastermain.settings.MANAGED:
2742 { 'name': 'Build', 2731 { 'name': 'Build',
2743 'dclass': 'span2', 2732 'dclass': 'span2',
2744 'qhelp': "Add or delete targets to / from your project ", 2733 'qhelp': "Add or delete targets to / from your project ",
2745 'filter': {
2746 'class': 'add-layer',
2747 'label': 'Show:',
2748 'options': [
2749 ('Targets provided by layers added to this project', "layer_version__projectlayer__project:" + str(prj.id), queryset_with_search.filter(layer_version__projectlayer__project = prj.id).count()),
2750 ('Targets provided by layers not added to this project', "layer_version__projectlayer__project:NOT" + str(prj.id), queryset_with_search.exclude(layer_version__projectlayer__project = prj.id).count()),
2751 ]
2752
2753 }
2754 }, ] 2734 }, ]
2755 2735
2756 response = render(request, template, context) 2736 response = render(request, template, context)
@@ -2782,52 +2762,25 @@ if toastermain.settings.MANAGED:
2782 prj = Project.objects.get(pk = request.session['project_id']) 2762 prj = Project.objects.get(pk = request.session['project_id'])
2783 compatible_layers = prj.compatible_layerversions() 2763 compatible_layers = prj.compatible_layerversions()
2784 2764
2785 # FILTERS SECTION
2786
2787 # Make sure we only show machines / layers which are compatible 2765 # Make sure we only show machines / layers which are compatible
2788 # with the current project 2766 # with the current project
2789 queryset_all = queryset_all.filter(layer_version__in=compatible_layers) 2767 queryset_all = queryset_all.filter(layer_version__in=compatible_layers)
2790 2768
2791 project_layers = ProjectLayer.objects.filter(project_id=request.session['project_id']).values_list('layercommit',flat=True) 2769 project_layers = ProjectLayer.objects.filter(project_id=request.session['project_id']).values_list('layercommit',flat=True)
2792 2770
2793 by_pass_filter_string = False
2794 # "special" filters identified by these valid filter strings we
2795 # by pass the usual filter applying method because we're filtering using
2796 # a subquery done by project_layers
2797
2798 if "name:inprj" in filter_string:
2799 queryset_all = queryset_all.filter(layer_version__in=project_layers)
2800 by_pass_filter_string = True
2801
2802 if "name:notinprj" in filter_string:
2803 queryset_all = queryset_all.exclude(layer_version__in=project_layers)
2804 by_pass_filter_string = True
2805
2806 # END FILTERS
2807
2808 if by_pass_filter_string:
2809 queryset = _get_queryset(Machine, queryset_all, None, search_term, ordering_string, '-name')
2810 else:
2811 queryset = _get_queryset(Machine, queryset_all, filter_string, search_term, ordering_string, '-name')
2812
2813 # Now we need to weed out the layers which will appear as duplicated 2771 # Now we need to weed out the layers which will appear as duplicated
2814 # because they're from a layer source which doesn't need to be used 2772 # because they're from a layer source which doesn't need to be used
2815 for machine in queryset: 2773 for machine in queryset_all:
2816 to_rm = machine.layer_version.get_equivalents_wpriority(prj)[1:] 2774 to_rm = machine.layer_version.get_equivalents_wpriority(prj)[1:]
2817 if len(to_rm) > 0: 2775 if len(to_rm) > 0:
2818 queryset = queryset.exclude(layer_version__in=to_rm) 2776 queryset_all = queryset_all.exclude(layer_version__in=to_rm)
2819 2777
2820 machine_info = _build_page_range(Paginator(queryset, request.GET.get('count', 10)),request.GET.get('page', 1))
2821 selected_filter_count = {}
2822 selected_filter_count['inprj'] = queryset.filter(layer_version__in=project_layers).count()
2823 selected_filter_count['notinprj'] = queryset.count() - selected_filter_count['inprj']
2824 2778
2825 context = { 2779 context = {
2826 'objects' : machine_info, 2780 'objects' : machine_info,
2827 'project_layers' : project_layers, 2781 'project_layers' : project_layers,
2828 'objectname' : "machines", 2782 'objectname' : "machines",
2829 'default_orderby' : 'name:+', 2783 'default_orderby' : 'name:+',
2830 'total_count': queryset.count(),
2831 2784
2832 'tablecols' : [ 2785 'tablecols' : [
2833 { 'name': 'Machine', 2786 { 'name': 'Machine',
@@ -2857,16 +2810,6 @@ if toastermain.settings.MANAGED:
2857 { 'name': 'Select', 2810 { 'name': 'Select',
2858 'dclass': 'select span2', 2811 'dclass': 'select span2',
2859 'qhelp': "Sets the selected machine as the project machine. You can only have one machine per project", 2812 'qhelp': "Sets the selected machine as the project machine. You can only have one machine per project",
2860 'filter': {
2861 'class': 'select',
2862 'label': 'Show:',
2863 'options': [
2864 (u'Machines provided by layers added to this project', 'name:inprj', selected_filter_count['inprj']),
2865 (u'Machines provided by layers not added to this project', 'name:notinprj', selected_filter_count['notinprj']),
2866
2867 ],
2868 }
2869
2870 }, 2813 },
2871 2814
2872 ] 2815 ]