On Feb 6, 2014, at 1:56 PM, Adrian Robert <adrian.b.rob...@gmail.com> wrote:

> Well, using the mapper event would be nicer, but in any case I was already 
> iterating over Base.classes and adding them to my own module's namespace like 
> so:
> 
>    globals()[cls.__name__] = cls
> 
> It works for the rest of my application being able to see the classes by 
> importing the module, but apparently not for this.  I'm not really expert at 
> Python class and namespace innards, but from the error message as well as the 
> default str() output it seems the automap-generated classes considers 
> themselves to be in the sqlalchemy.ext.automap module but are not registered 
> in that namespace.
> 
> Is there a way to tell the classes to use a different namespace from an 
> instrument_class handler?  (And incidentally I'm already using my own base 
> class through automap_base(declarative_base(cls=...)) but that doesn't make 
> any difference.)

I’m seeing that and working with a rudimental example I’m not seeing a solution 
to it.    You can as automap suggests create the classes explicitly.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to