On 8/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hi, I wanted to test out some code in the terminal, as that's
> generally quicker than constantly reloading a page and I couldn't get
> the web.select to work. Here's what I did:
>
> >>> 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!
Try doing
web.load()
before the first query.
--
Hermann Käser
http://theragingche.com/
http://semicir.cl/user/hermzz
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---