コード例 #1
0
ファイル: test.py プロジェクト: BuloZB/development
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))
コード例 #2
0
ファイル: web.py プロジェクト: yen6465/development
 def GET(self):
   web.header('Content-Type', 'application/json')
   feed = Feed(mysql)
   return json.dumps(feed.list(3))
コード例 #3
0
ファイル: test.py プロジェクト: yen6465/development
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))