<?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>8866</bug_id>
          
          <creation_ts>2016-01-04 11:48:07 +0000</creation_ts>
          <short_desc>Home-brew JSON encoding is ad hoc and incomplete</short_desc>
          <delta_ts>2023-12-14 04:24:42 +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>2.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>   </status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Elliot Smith">elliot.smith</reporter>
          <assigned_to name="Toaster default assignee">toaster</assigned_to>
          <cc>belen.barros.pena</cc>
    
    <cc>david.reyna</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>jose.perez.carranza</cc>
    
    <cc>stanciux.mihail</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</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>57503</commentid>
    <comment_count>0</comment_count>
    <who name="Elliot Smith">elliot.smith</who>
    <bug_when>2016-01-04 11:48:07 +0000</bug_when>
    <thetext>The JSON encoder used to convert querysets to JSON responses is hand-cranked and incomplete. It recently caused an issue where we had a decimal field in a queryset and our encoder didn&apos;t know what to do with it, so it failed with a mostly incomprehensible error.

objtojson() in toastergui/views.py is the main offender, closely followed by the code locations which call that function.

Rather than use objtojson() and friends, we should use the Django JSON encoder as far as possible, and maybe even the Django JSON HTTP response classes when encoding the body of a response.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>