well here is the funny thing, is that I was sure back in November that someone would soon mention this, and I'd have to look into some more elaborate way to call __new__ instead of __init__ etc., then some people might want it configurable, but here we are 6 months later and you are the first to mention it.

so at the moment theres no terrific way to do what you want, other than adding a flag to your __init__ method that says, "do the init" stuff, since SA calls the __init__ with no arguments.

its probably worthwhile for me to look into using __new__ for 0.2 and to create objects from the DB more the way "pickle" does it. ill see how that goes.

On Apr 22, 2006, at 10:19 PM, Tim Van Steenburgh wrote:

Is the __init__() method of a class instance called every time an object is loaded from the DB?

If so, what should I do with code that should only execute when an object is first created, but not when it is reloaded from the DB?

Thanks,
Tim



-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to