Charles Duffy wrote:

> I'm unclear on what the most appropriate way to specify the engine to
> use for other threads is.

I am not exactly sure what you mean by this, but I suspect that the
problem has two components:

   1. The way that you are specifying the metadata for your model.  I
      already followed up to this list with a separate message showing
      you part of your problem, but I would actually recommend that you
      stick with this:

          from sqlalchemy import *
          from sqlalchemy.ext import activemapper

          engine = create_engine(url)
          activemapper.metadata.connect(engine)

      and don't set a '__metadata__' at all on any of your ActiveMapper
      classes, as this is really only needed if you have more than one
      database to deal with (which most people don't).

   2. TurboGears was recently modified to have its SQLAlchemy support
      changed completely to work with SQLAlchemy 0.2.2, but the way
      it works was completely changed to not use ActiveMapper, I think.
      There is a good chance that there might need to be some changes
      to the TurboGears code to make it work with ActiveMapper again
      (but I know that there are people that want to see this happen.)

> Any hints? (If this belongs on the TurboGears list rather than the
> SQLAlchemy one, btw, do let me know).

I would suggest first fixing the problem about how you are specifying
your metadata as suggested in item #1 above, and then get the folks
from TurboGears involved to make sure that TurboGears is doing all that
is needed to support ActiveMapper *and* plain-old SQLAlchemy.

Best of luck --

--
Jonathan LaCour
http://cleverdevil.org




_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to