[bitbake-devel] [PATCH 19/27] toaster: All machines Add layer name order by functions

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


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

Allow the layer name to be sorted alphabetically in the machines table.
Also fix the default ordering to be machine name

Signed-off-by: Michael Wood <michael.g.wood at intel.com>
---
 lib/toaster/toastergui/templates/machines.html | 2 +-
 lib/toaster/toastergui/views.py                | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/toaster/toastergui/templates/machines.html b/lib/toaster/toastergui/templates/machines.html
index 487d6b7..650c47b 100644
--- a/lib/toaster/toastergui/templates/machines.html
+++ b/lib/toaster/toastergui/templates/machines.html
@@ -31,7 +31,7 @@
 <div class="page-header">
   <h1>
     All machines
-    <i class="icon-question-sign get-help heading-help" title="This page lists all the machines compatible with Yocto Project 1.7 'Dxxxx' that Toaster knows about. They include community-created targets suitable for use on top of OpenEmbedded Core and any targets you have imported"></i>
+    <i class="icon-question-sign get-help heading-help" title="This page lists all the machines compatible with the current project that Toaster knows about. They include community-created targets suitable for use on top of OpenEmbedded Core and any targets you have imported"></i>
   </h1>
 </div>
 
diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py
index c89b67b..2e52d2b 100755
--- a/lib/toaster/toastergui/views.py
+++ b/lib/toaster/toastergui/views.py
@@ -2777,7 +2777,7 @@ if toastermain.settings.MANAGED:
         # define here what parameters the view needs in the GET portion in order to
         # be able to display something.  'count' and 'page' are mandatory for all views
         # that use paginators.
-        (pagesize, orderby) = _get_parameters_values(request, 10, 'updated:+')
+        (pagesize, orderby) = _get_parameters_values(request, 10, 'name:+')
         mandatory_parameters = { 'count': pagesize,  'page' : 1, 'orderby' : orderby };
         retval = _verify_parameters( request.GET, mandatory_parameters )
         if retval:
@@ -2815,6 +2815,8 @@ if toastermain.settings.MANAGED:
                 },
                 {   'name': 'Layer',
                     'clclass': 'layer',
+                    'orderfield': _get_toggle_order(request, "layer_version__layer__name"),
+                    'ordericon' : _get_toggle_order_icon(request, "layer_version__layer__name"),
                 },
                 {   'name': 'Layer source',
                     'clclass': 'source',
-- 
1.9.1




More information about the bitbake-devel mailing list