[bitbake-devel] [PATCH 26/27] toaster: All machines Fix filter counts

Alex DAMIAN alexandru.damian at intel.com
Mon Feb 9 18:01:56 UTC 2015


From: Michael Wood <michael.g.wood at intel.com>

Filter counts needed to take into account the filters that had
previously been applied.

Signed-off-by: Michael Wood <michael.g.wood at intel.com>
---
 lib/toaster/toastergui/views.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py
index 255b6a3..a7f58ad 100755
--- a/lib/toaster/toastergui/views.py
+++ b/lib/toaster/toastergui/views.py
@@ -2814,11 +2814,6 @@ if toastermain.settings.MANAGED:
           queryset_all = queryset_all.exclude(layer_version__in=project_layers)
           by_pass_filter_string = True
 
-        selected_filter_count = {
-          'inprj' : queryset_all.filter(layer_version__in=project_layers).count(),
-          'notinprj' : queryset_all.exclude(layer_version__in=project_layers).count()
-        }
-
         # END FILTERS
 
         if by_pass_filter_string:
@@ -2834,13 +2829,16 @@ if toastermain.settings.MANAGED:
              queryset = queryset.exclude(layer_version__in=to_rm)
 
         machine_info = _build_page_range(Paginator(queryset, request.GET.get('count', 10)),request.GET.get('page', 1))
+        selected_filter_count = {}
+        selected_filter_count['inprj'] = queryset.filter(layer_version__in=project_layers).count()
+        selected_filter_count['notinprj'] = queryset.count() - selected_filter_count['inprj']
 
         context = {
             'objects' : machine_info,
             'project_layers' : project_layers,
             'objectname' : "machines",
             'default_orderby' : 'name:+',
-            'total_count': machine_info.paginator.count,
+            'total_count': queryset.count(),
 
             'tablecols' : [
                 {   'name': 'Machine',
-- 
1.9.1




More information about the bitbake-devel mailing list