title: Sqlalchemy query returns Decimal object
body: <p>I have the following model:</p>
  
  <pre><code>  172  class ReportRecord(db.Model):                                                                                                                                                                                
    173     __tablename__ = 'tb_report_record'                                                                                                                                                                         174                                                                                                                                                                                                                175     id = db.Column(Integer, primary_key=True)                                                                                                                                                                
    176     report_id = db.Column(ForeignKey('tb_rua_report.id'), index=True)                                                                                                                                        
    177     source_ip = db.Column(String(100, 'utf8_bin'))                                                                                                                                                           
    178     count = db.Column(Integer)                                                                                                                                                                               
    179     disposition = db.Column(String(10, 'utf8_bin'))                                                                                                                                                          
    180     header_from = db.Column(String(100, 'utf8_bin'))                                                                                                                                                         
    181     spf_domain = db.Column(String(100, 'utf8_bin'))                                                                                                                                                          
    182     spf_result = db.Column(String(10, 'utf8_bin'))                                                                                                                                                           
    183     dkim_domain = db.Column(String(100, 'utf8_bin'))                                                                                                                                                         
    184     dkim_result = db.Column(String(10, 'utf8_bin'))                                                                                                                                                          
    185     isActive = db.Column(Integer, nullable=False, server_default=text("'1'"))                                                                                                                                  186     created_by = db.Column(String(100), nullable=False, server_default=text("'System'"))                                                                                                                     
    187     created_dt = db.Column(DateTime, nullable=False)                                                                                                                                                         
    188     last_modified_by = db.Column(String(100), nullable=False, server_default=text("'System'"))                                                                                                               
    189     last_modified_dt = db.Column(DateTime, server_default=text("CURRENT_TIMESTAMP"))                                                                                                                         
    190                                                                                                                                                                                                              
    191     report = db.relationship('RuaReport', backref=db.backref("record"))
  </code></pre>
  
  <p>When I am issuing the following query from <code>flasksqlalchemy</code></p>
  
  <pre><code>ReportRecord.query.filter(or_(ReportRecord.spf_result=="pass", ReportRecord.dkim_result=="pass")).with_entities(func.sum(ReportRecord.count).label('total_passed')).all()
  </code></pre>
  
  <p>I get the following output:</p>
  
  <p><code>[(Decimal('930'),)]</code></p>
  
  <p>Now the value that I get is correct, but I cannot <code>jsonify</code> it directly. Doing a <code>int(Decimal('930'))</code> does give me the desired result but what is the default way to get this data converted in the right format?</p>