import MySQLdb import MySQLdb.cursors import json from Feed import Feed db = MySQLdb.connect(host="localhost",user="******",passwd="",db="emoncms",cursorclass=MySQLdb.cursors.DictCursor) cursor = db.cursor() feed = Feed(cursor) print json.dumps(feed.list(3))
def GET(self): web.header('Content-Type', 'application/json') feed = Feed(mysql) return json.dumps(feed.list(3))
import MySQLdb import MySQLdb.cursors import json from Feed import Feed db = MySQLdb.connect(host="localhost", user="******", passwd="", db="emoncms", cursorclass=MySQLdb.cursors.DictCursor) cursor = db.cursor() feed = Feed(cursor) print json.dumps(feed.list(3))