re: Michael Bayer & Mike Orr

thanks for the pointers.  wish i had checked in on this thread before
coding last night :[

I already updated some old pylons code (and sqlalchemy .4 version) to
work under pyramid and take advantage of zope

i tossed it online here :  https://gist.github.com/1686834

it /only/ works for reflected tables.  perhaps there's a way to
integrate with the declarative stuff that mike has been supporting.

it does the following:
- uses a dict in the package as a registry of "wrapped engines"
-- a wrapped engine is a light object that just stores the following
sqlachemy objects: engine, sessionmaker (and the params used for it),
and session
- stores returns the correct session via looking up the name in the
engine registry.  e.g. dbSession('read')
- traverses a package looking for objects that inherit from
"ReflectedTable"
- stores too much info for debugging
-- the 'Table' data is stashed into the reflected classes
-- EngineWrapper doesn't need half of the items in it

i'll likely make this more proper in the future, but its working right
now and I can get back to migrating a project.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en.

Reply via email to