how do i import sqlbuilder ?

3 views
Skip to first unread message

Todd Greenwood

unread,
Oct 26, 2005, 1:38:07 AM10/26/05
to TurboGears
How do I import sqlbuilder? The thread below shows:

http://groups.google.com/group/turbogears/browse_frm/thread/8995eb433f01b03d/6a3106bfb98c3933?q=sqlbuilder&rnum=1#6a3106bfb98c3933
#controllers.py
from sqlobject.sqlbuilder import LEFTJOINOn

That givos me: "ImportError: cannot import name sqlbuilder"

I'd like to do this:

class Entry(SQLObject):
mod_date_time = DateTimeCol(default=sqlbuilder.func.now())

but I can't get that or any variant i can think of to work...so I'm
using:

class Entry(SQLObject):
mod_date_time = DateTimeCol(default=datetime.datetime.now())

Any ideas?

-Todd

Todd Greenwood

unread,
Oct 26, 2005, 1:54:12 AM10/26/05
to TurboGears
This is what works for me in python (tg-admin shell):
from sqlobject.sqlbuilder import *

This does not work for me in python:
from SQLBuilder import *

the last is doc'd here: http://sqlobject.org/SQLBuilder.html

So my question is boiling down to, what's the right way to import
sqlbuilder and are the docs in error, or is it just me?

Todd Greenwood

unread,
Oct 26, 2005, 3:00:40 AM10/26/05
to TurboGears

Kevin Dangoor

unread,
Oct 26, 2005, 9:08:57 AM10/26/05
to turbo...@googlegroups.com
Those docs are out of date. sqlobject and sqlbuilder package names are
lower case now (as is the Python convention)

Kevin
Reply all
Reply to author
Forward
0 new messages