按照 HowTo write a basic Blog,step by step,最后运行,却报类似下面的错误:
错误信息
File
'D:\development\python\projects\blogtutorial\blogtutorial\controllers\blog.py'
,
line 
12 in list
c.blogPosts 
= list(model.BlogPosts.select())
File
'D:\development\python\
2.4.4\lib\site-packages\sqlobject-0.7.1-py2.4.egg\sqlobject\sresults.py',
line 
155 in __iter__
return iter(list(self.lazyIter()))
File
'D:\development\python\
2.4.4\lib\site-packages\sqlobject-0.7.1-py2.4.egg\sqlobject\sresults.py',
line 
162 in lazyIter
conn 
= self._getConnection()
File
'D:\development\python\
2.4.4\lib\site-packages\sqlobject-0.7.1-py2.4.egg\sqlobject\sresults.py',
line 
38 in _getConnection
return self.ops.get('connection') or self.sourceClass._connection
File
'd:\development\python\
2.4.4\lib\site-packages\Pylons-0.9.3-py2.4.egg\pylons\database.py',
line 
104 in __get__
return self.hub.__get__(obj
, type)
File
'D:\development\python\
2.4.4\lib\site-packages\sqlobject-0.7.1-py2.4.egg\sqlobject\dbconnection.py',
line 
888 in __get__
return self.getConnection()
File
'D:\development\python\
2.4.4\lib\site-packages\sqlobject-0.7.1-py2.4.egg\sqlobject\dbconnection.py',
line 
900 in getConnection
raise AttributeError(
AttributeError: No connection has been defined for this thread or
process
苦苦搜索了一番,终于找到以下答案:

sqlobject support not working

Reported by: climbus Assigned to: benbangert
Priority: highest Milestone: 0.9.4
Component: middleware Version: 0.9.3
Severity: blocker Keywords:
Cc:

Description ¶

In database.py->AutoConnectHub->get_connection() must be getConnection() because in slobject->ConnectionHub->getConnection()



欢迎大家访问我的个人网站 萌萌的IT人