On Apr 22, 2006, at 2:39 PM, Daniel Miller wrote:

    # test create_metaclass
    context = ThreadLocalSessionContext(objectstore.Session)
    meta = create_metaclass(context)
    class MyClass(object): __metaclass__ = meta
    run_test(MyClass, context)


how about this:

        import sqlalchemy.ext.sessioncontext as sessioncontext

context = sessioncontext.ThreadLocalSessionContext() # create_session is the default factory
        
        class Foo(object):
                __metaclass__ = context.metaclass

        class Bar(object):
                __metaclass__ = context.metaclass

?

also, with create_baseclass, should we call it more of a mixin ? that way it doesnt get in the way of an inheritance hierarchy (even though it would usually be at the base...but then maybe someone wants different contexts in one hierarchy !):

        context = sessioncontext.ThreadLocalSessionContext()
        
        class Bar(Foo, context.mixin):
                # etc..

im just going for something as sparse as possible here...things catch on better when theyre like that !

also i have shuffled around the packages as I described, session stuff is in sqlalchemy.orm.session, the "objectstore" name is only in the threadlocal mod at the moment.



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to