>>> import web
>>> web.config.db_parameters = dict(dbn='mysql', user='my_db_user', pw='my_db_pw', db='my_db_name', charset="utf8")
>>> tags = web.select('tags_posts LEFT JOIN tags ON tags.id=tags_posts.tag_id', what='tags.id, tags.name', where='tags_posts.post_id=\'1\' ORDER BY tags.name ASC')
I then got the following errors:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/web/db.py", line 584, in select
return query(qout, processed=True)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/web/db.py", line 436, in query
db_cursor = web.ctx.db_cursor()
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/web/utils.py", line 706, in __getattr__
return getattr(self.__d[threading.currentThread()], attr)
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/web/utils.py", line 54, in __getattr__
raise AttributeError, k
AttributeError: 'db_cursor'
Any thoughts would be appreciated, thanks!
-Dougal
Try doing
web.load()
before the first query.
--
Hermann Käser
http://theragingche.com/
http://semicir.cl/user/hermzz