<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>8011</bug_id>
          
          <creation_ts>2015-07-15 11:48:57 +0000</creation_ts>
          <short_desc>Sorting columns breaks Toaster</short_desc>
          <delta_ts>2015-09-29 10:57:48 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Toaster</product>
          <component>toaster</component>
          <version>1.9</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>8131</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mihail Stanciu">stanciux.mihail</reporter>
          <assigned_to name="Michael Wood">michael.g.wood</assigned_to>
          <cc>alexandru.damian</cc>
    
    <cc>belen.barros.pena</cc>
    
    <cc>cristiana.voicu</cc>
    
    <cc>cristina-danielax.agurida</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>ke.zou</cc>
          
          <qa_contact name="Mihail Stanciu">stanciux.mihail</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>Regression (Used to work)</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>52395</commentid>
    <comment_count>0</comment_count>
    <who name="Mihail Stanciu">stanciux.mihail</who>
    <bug_when>2015-07-15 11:48:57 +0000</bug_when>
    <thetext>Tested on 1.9 M1 RC2: f9ea480e6c26fea46c3011c4e9d0e2de3d5c81b4

In the &quot;All Builds&quot; table sorting by &quot;Errors&quot;, &quot;Warnings&quot; or &quot;Time&quot; causes Toaster to throw an exception:

BaseException at /toastergui/builds/

Invalid ordering model:&lt;class &apos;orm.models.Build&apos;&gt;(u&apos;timespent&apos;, [&apos;bitbake_version&apos;, &apos;build_name&apos;, &apos;buildartifact&apos;, &apos;buildrequest&apos;, &apos;completed_on&apos;, &apos;cooker_log_path&apos;, &apos;distro&apos;, &apos;distro_version&apos;, &apos;helptext_build&apos;, u&apos;id&apos;, &apos;layer_version_build&apos;, &apos;logmessage&apos;, &apos;machine&apos;, &apos;outcome&apos;, &apos;package&apos;, &apos;project&apos;, &apos;started_on&apos;, &apos;target&apos;, &apos;task_build&apos;, &apos;variable_build&apos;])

Request Method: 	GET
Request URL: 	http://localhost:8000/toastergui/builds/?orderby=timespent%3A-&amp;count=10&amp;search=&amp;page=1
Django Version: 	1.6.6
Exception Type: 	BaseException
Exception Value: 	

Invalid ordering model:&lt;class &apos;orm.models.Build&apos;&gt;(u&apos;timespent&apos;, [&apos;bitbake_version&apos;, &apos;build_name&apos;, &apos;buildartifact&apos;, &apos;buildrequest&apos;, &apos;completed_on&apos;, &apos;cooker_log_path&apos;, &apos;distro&apos;, &apos;distro_version&apos;, &apos;helptext_build&apos;, u&apos;id&apos;, &apos;layer_version_build&apos;, &apos;logmessage&apos;, &apos;machine&apos;, &apos;outcome&apos;, &apos;package&apos;, &apos;project&apos;, &apos;started_on&apos;, &apos;target&apos;, &apos;task_build&apos;, &apos;variable_build&apos;])

Exception Location: 	/home/gushie/poky/bitbake/lib/toaster/toastergui/views.py in _search_tuple, line 329
Python Executable: 	/usr/bin/python
Python Version: 	2.7.8
Python Path: 	

[&apos;bitbake/bin/../lib&apos;,
 &apos;/home/gushie/poky/bitbake/lib&apos;,
 &apos;/home/gushie/poky/bitbake/lib/toaster&apos;,
 &apos;/usr/lib64/python27.zip&apos;,
 &apos;/usr/lib64/python2.7&apos;,
 &apos;/usr/lib64/python2.7/plat-linux2&apos;,
 &apos;/usr/lib64/python2.7/lib-tk&apos;,
 &apos;/usr/lib64/python2.7/lib-old&apos;,
 &apos;/usr/lib64/python2.7/lib-dynload&apos;,
 &apos;/usr/lib64/python2.7/site-packages&apos;,
 &apos;/usr/lib64/python2.7/site-packages/gtk-2.0&apos;,
 &apos;/usr/lib/python2.7/site-packages&apos;,
 &apos;/home/gushie/poky/bitbake/lib/toaster/contrib/django-aggregate-if-master&apos;]

Traceback in next comment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52396</commentid>
    <comment_count>1</comment_count>
    <who name="Mihail Stanciu">stanciux.mihail</who>
    <bug_when>2015-07-15 11:49:24 +0000</bug_when>
    <thetext>Traceback:
Environment:


Request Method: GET
Request URL: http://localhost:8000/toastergui/builds/?count=10&amp;orderby=timespent%3A-&amp;page=1

Django Version: 1.6.6
Python Version: 2.7.8
Installed Applications:
(&apos;django.contrib.auth&apos;,
 &apos;django.contrib.contenttypes&apos;,
 &apos;django.contrib.messages&apos;,
 &apos;django.contrib.sessions&apos;,
 &apos;django.contrib.admin&apos;,
 &apos;django.contrib.staticfiles&apos;,
 &apos;django.contrib.humanize&apos;,
 &apos;bldcollector&apos;,
 &apos;toastermain&apos;,
 &apos;south&apos;,
 &apos;toastergui&apos;,
 &apos;bldcontrol&apos;,
 &apos;orm&apos;)
Installed Middleware:
(&apos;django.middleware.common.CommonMiddleware&apos;,
 &apos;django.contrib.sessions.middleware.SessionMiddleware&apos;,
 &apos;django.middleware.csrf.CsrfViewMiddleware&apos;,
 &apos;django.contrib.auth.middleware.AuthenticationMiddleware&apos;,
 &apos;django.contrib.messages.middleware.MessageMiddleware&apos;)


Traceback:
File &quot;/usr/lib64/python2.7/site-packages/django/core/handlers/base.py&quot; in get_response
  112.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File &quot;/home/gushie/poky/bitbake/lib/toaster/toastergui/views.py&quot; in returned_wrapper
  138.                 context = view(request, *args, **kwargs)
File &quot;/home/gushie/poky/bitbake/lib/toaster/toastergui/views.py&quot; in builds
  1886.             context, pagesize, orderby = _build_list_helper(request, queryset)
File &quot;/home/gushie/poky/bitbake/lib/toaster/toastergui/views.py&quot; in _build_list_helper
  1906.         (filter_string, search_term, ordering_string) = _search_tuple(request, Build)
File &quot;/home/gushie/poky/bitbake/lib/toaster/toastergui/views.py&quot; in _search_tuple
  329.         raise BaseException(&quot;Invalid ordering model:&quot; + str(model) + str(invalid))

Exception Type: BaseException at /toastergui/builds/
Exception Value: Invalid ordering model:&lt;class &apos;orm.models.Build&apos;&gt;(u&apos;timespent&apos;, [&apos;bitbake_version&apos;, &apos;build_name&apos;, &apos;buildartifact&apos;, &apos;buildrequest&apos;, &apos;completed_on&apos;, &apos;cooker_log_path&apos;, &apos;distro&apos;, &apos;distro_version&apos;, &apos;helptext_build&apos;, u&apos;id&apos;, &apos;layer_version_build&apos;, &apos;logmessage&apos;, &apos;machine&apos;, &apos;outcome&apos;, &apos;package&apos;, &apos;project&apos;, &apos;started_on&apos;, &apos;target&apos;, &apos;task_build&apos;, &apos;variable_build&apos;])</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52632</commentid>
    <comment_count>2</comment_count>
    <who name="Alexandru Damian">alexandru.damian</who>
    <bug_when>2015-07-27 15:48:33 +0000</bug_when>
    <thetext>This breaks because &quot;timespent&quot; is not a field in the database, but it is calculated on the fly.

There are two ways to go about here:

a). disable sorting by time spent

b). add the field to the database


Belen, we need your input.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52646</commentid>
    <comment_count>3</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2015-07-28 09:27:38 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; This breaks because &quot;timespent&quot; is not a field in the database, but it is
&gt; calculated on the fly.

It looks like this would explain why sorting by &apos;time&apos; throws an error, but I am not sure it explains why sorting by &apos;errors&apos; and &apos;warnings&apos; also throws an error. Although the error seems to be the same error in all cases, so I could be wrong. 

&gt; 
&gt; There are two ways to go about here:
&gt; 
&gt; a). disable sorting by time spent
&gt; 
&gt; b). add the field to the database

I am ok with disabling the sorting by &apos;time&apos;, unless we think that adding the field to the database could improve performance in any way. 

&gt; 
&gt; 
&gt; Belen, we need your input.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53231</commentid>
    <comment_count>4</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2015-08-19 15:30:54 +0000</bug_when>
    <thetext>*** Bug 8131 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53590</commentid>
    <comment_count>5</comment_count>
    <who name="Belen Barros Pena">belen.barros.pena</who>
    <bug_when>2015-09-01 10:10:22 +0000</bug_when>
    <thetext>*** Bug 8228 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54751</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Wood">michael.g.wood</who>
    <bug_when>2015-09-28 17:42:03 +0000</bug_when>
    <thetext>Triggers the same problem caused by bug #8131

*** This bug has been marked as a duplicate of bug 8131 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54779</commentid>
    <comment_count>7</comment_count>
    <who name="Cristina Agurida">cristina-danielax.agurida</who>
    <bug_when>2015-09-29 10:57:48 +0000</bug_when>
    <thetext>As per last comment set it as verified duplicate.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>