Re: [sqlalchemy] custom __init__ methods not being invoked

2013-02-13 Thread Ryan McKillen
Thanks for the details. Makes sense. Still not consistent with what I'm experiencing. Although consistent with what I'm seeing when I put a simple example/test together. I'll keep digging... — RM On Feb 12, 2013, at 4:51 PM, Michael Bayer mike...@zzzcomputing.com wrote: its called in all SQL

Re: [sqlalchemy] custom __init__ methods not being invoked

2013-02-12 Thread Ryan McKillen
It doesn't appear that the method decorated by @orm.reconstructor is called on objects retrieved/loaded as relationships. Not my desired behavior, but I guess it is consistent with the docs: When instances are loaded during a Query operation as in query(MyMappedClass).one(), init_on_load is

Re: [sqlalchemy] custom __init__ methods not being invoked

2013-02-12 Thread Michael Bayer
its called in all SQL loading scenarios including that of relationships. A relationship load might not actually result in the object being loaded from the DB in these scenarios: 1. the relationship is a simple many-to-one, and the object could be located by primary key from the identity map

Re: [sqlalchemy] custom __init__ methods not being invoked

2013-01-07 Thread Michael van Tellingen
See http://docs.sqlalchemy.org/en/latest/orm/mapper_config.html#constructors-and-object-initialization On Mon, Jan 7, 2013 at 4:47 AM, RM ryan.mckil...@gmail.com wrote: I have a class which inherits from Base. My class has a metaclass which inherits from DeclarativeMeta. Among other things,

Re: [sqlalchemy] custom __init__ methods not being invoked

2013-01-07 Thread Ryan McKillen
Worked like a charm. Thanks. — RM On Mon, Jan 7, 2013 at 6:26 PM, Michael van Tellingen michaelvantellin...@gmail.com wrote: See http://docs.sqlalchemy.org/en/latest/orm/mapper_config.html#constructors-and-object-initialization On Mon, Jan 7, 2013 at 4:47 AM, RM ryan.mckil...@gmail.com

[sqlalchemy] custom __init__ methods not being invoked

2013-01-06 Thread RM
I have a class which inherits from Base. My class has a metaclass which inherits from DeclarativeMeta. Among other things, the metaclass adds an __init__ method to the class dictionary. When I instantiate an instance of my class directly, my __init__ method is invoked, but if I use the ORM to