Example #1
0
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))
Example #2
0
 def GET(self):
   web.header('Content-Type', 'application/json')
   feed = Feed(mysql)
   return json.dumps(feed.list(3))
Example #3
0
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))