Hi Randall,
You don't *have* to use one of those two hubs unless you want
TurboGears' database features (TG config file for the connection URI,
automatic connection per thread, automatic transactions in 0.9).
Setting _connection on the class to the hub is a fine way to set the
hub. You might also try module.__connection__ = hub, which is what TG
does in quickstart projects.
Kevin
On 1/5/06, Randall <[EMAIL PROTECTED]> wrote:
>
> I've got many existing SQLObject classes that I would like to use in
> TurboGears. They are designed with no connection specified so that
> they automatically pick up sqlobject.sqlhub. I'm new to TG, so please
> take into consideration my ignorance. I looked at AutoConnectHub and
> PackageHub. It looks like I have to use one of these two with my
> SQLObject classes to get them to work.
>
> I've managed to get this to work like so:
>
> In Model.py
>
> hub = PackageHub("mypackage")
> MySQLObjectClass._connection = hub
>
> Is this a good way to set the connection?
>
> Randall
>
>
--
Kevin Dangoor
Author of the Zesty News RSS newsreader
email: [EMAIL PROTECTED]
company: http://www.BlazingThings.com
blog: http://www.BlueSkyOnMars.com