次のタスクを実行すると、このエラーが発生します。
results = db1.executeSelectCommand(siteSql、()、)TypeError:バインドされていないメソッドexecuteSelectCommand()は、dbConnnインスタンスを最初の引数として呼び出す必要があります(代わりにstrインスタンスを取得します)
私のコードは次のとおりです。
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では、これに問題はないようですか?神様、それは本当に初歩的なものに違いありませんが、私はそれを見つけることができません。