[web2py] Custom field name in db().select()

2013-10-20 Thread Sergio R.
Im using adhoc calculated field ( db.hourlydata.TotalAsh / db.hourlydata.TotalMass ) in db().select() statement. rows = db( db.hourlydata.DevId==1 ).select( db.hourlydata.DevId, db.hourlydata.TotalAsh / db.hourlydata.TotalMass ) Is it possible to define custom names for fields in db().select()

[web2py] Transforming db data to json in web2py for visualization with flot.js

2013-09-11 Thread Sergio R.
I'm having problem to get a valid json string for flot.js visualisation from db data in web2py. This is my controller action: def getdata(): return dict(data=db().select(db.realtimedata.id, db.realtimedata.FlowRate, limitby=(0, 3), orderby=~db.realtimedata.id)) Generic json view returns