percious wrote:
> So, I did some experimentation tonight using the engine as an
> identifier.
>
> The problem is that I have no way of knowing which class is mapped to
> which engine without binding them.  Maybe I'm missing something
> here...
>   

from sqlalchemy import orm
mapper = orm.class_mapper(MyClass)
# introspect the mapper...


This is how RumAlchemy gets information about a mapped class' properties:
http://toscawidgets.org/hg/RumAlchemy/file/tip/rumalchemy/util.py

IIRC, you don't *need* a connection to a database (engine) to introspect 
the mapper. For CRUD operations you just need a reference to DBSession 
so you can create Query objects from a mapped class. You can safely 
assume that DBSession has already been bound to an engine somehow I guess.


Alberto

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" 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-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to