好人, 我已经在我的django项目中安装了djangoratings,我想直接使用djangoratings表中的原始sql选择记录,我遵循给定的指令here,但似乎没有任何工作。为什么Django原始查询不起作用
我的代码看起来像这样;
def InsertRecord():
from django.db import connection, transaction
cursor = connection.cursor()
cursor.execute(" Select ip_address from djangoratings_vote where id=%d ",[3])
row = cursor.fetchone()
print row # row has None at this point
该函数不会选择行,尽管它存在于表中。 正在使用,django 1.2.1,sqlite3
我在做什么?
迦特