0
results = db1.executeSelectCommand(siteSql,(),) TypeError: unbound method executeSelectCommand() must be called with dbConnn instance as first argument (got str instance instead)
我的代码如下这个错误,当我执行以下任务:
class dbConnn:
db_con = None
execfile("/Users/usera/Documents/workspace/testing/src/db/db_config.py")
def executeSelectCommand(self,sql,ip):
#psycopg connection here.
我在这里使用这个类:
from db import dbConnections
db1 = dbConnections.dbConnn
siteSql = 'select post_content from post_content_ss order by RANDOM() limit 500' #order by year,month ASC'
results = db1.executeSelectCommand(siteSql,(),)
在windows中,这似乎没有问题?上帝,它一定是真正的初级,但我找不到它。
谢谢。请原谅我这样一个愚蠢的错误。 – goh 2010-08-16 03:25:27