def GET(self): import simplejson as json from db import generalView web.header('content-Type', 'application/json') def dthandler(obj): obj.fecha = obj.fecha.strftime("%F %H:%M:%S") return obj return json.dumps([dthandler(row) for row in generalView()])
def GET(self): import simplejson as json from db import generalView #views = DB.query("""SELECT l.position, v.placa, g.name, l.fecha, # l.velocidad, l.altura, l.satelites, l.ubicacion # FROM vehiculos v, last_positions_gps l, gps g # WHERE v.gps_id=g.id AND g.id=l.gps_id""") web.header('content-Type', 'application/json') def dthandler(obj): obj.fecha = obj.fecha.strftime("%F %H:%M:%S") return obj #return json.dumps([dthandler(row) for row in views]) return json.dumps([dthandler(row) for row in generalView()])
def GET(self): from db import generalView return render.admin.viewmonitoreo(generalView())