On 6/13/06, Krys <[EMAIL PROTECTED]> wrote:

> A further possible step is to set __connection__ on each model to the
> appropriate PackageHub within a single model file.  This still required
> 3 models, though.  Also, I'm not sure about hub, then.  Maybe no have a
> global hub in model.py but make a hub attribute on each model class?
>
> Lastly, I suppose, if you wanted to use the same model classes, you
> could instantiate them and then monkeypatch the __connection__
> attribute afterwards to use the correct PackageHub.

> Hope this helps,
>
> Krys

Thanks for your reply.
I do some hack on model.py:
so using one model.py and it works


hub = PackageHub("myquickstart")
__connection__ = hub

#Add Second DB Connections
second_hub = connectionForURI('sqlite:/home/neo/solar/cmts.sqlite')

...

class SecondDBData(SQLObject):
    _connection = cmts_hub

    name = UnicodeCol()
    ...

I use SQLObject class _connection attributes
not sqlmeta (sqlmeta don't have  _connection?)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to