Hi again,

On 6/28/06, Randall <[EMAIL PROTECTED]> wrote:
>
> I'm using SA with the latest patch for identity.  During startup, on
> line 153 of saprovider.py, an attempt is made to access the engine for
> one of the tables.
>
> File
> "/home/randall/downloads/svn/turbogears/turbogears/identity/saprovider.py",
> line 153, in create_provider_model
>     engine = table.metadata.engine
>
> Apparently, no engine is defined, so the last line of the traceback
> looks like this:
>
>   File "/home/randall/downloads/svn/sqlalchemy/lib/sqlalchemy/util.py",
> line 189, in __getattr__
>     raise AttributeError(key)
> AttributeError: _engine
>
> I use DynamicMetaData and connect the metada in model.py.

Does it make a difference if you use a BoundMetaData for the identity
classes? You can still use a DynamicMetaData for the other classes?

>  The code for
> this is below, but I'll discuss it here.  Other than identity, my DB
> code works find in other parts of the application.  Also, tg-admin
> shell works find with DB objects.  I'm not knowledeable of the inner
> workings of TG on startup, but somehow, even though the engine is bound
> in model.py and in all CherryPy threads, it's not bound when the
> identity code calls for it.  Any ideas?

I'm not too sure on TG startup myself, but this code is called from
start_extension. In any case, when the class is imported in saprovider
via turbogears.util.load_class - I thought module-level code in
model.py would be executed (a simple experiment verfied this).

What do you have in app.cfg for identity.saprovider.model.* ?


> Here is some of my code in mode.py
>
> engine = PackageEngine("tgwater")
>
> # Auth
> User = sqla.fetchClass('web', 'User')

What does fetchClass do?


Arnar

--~--~---------~--~----~------------~-------~--~----~
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