17 messages in com.googlegroups.sqlalchemy[sqlalchemy] Re: Use of new_instance(...| From | Sent On | Attachments |
|---|---|---|
| Phillip J. Eby | 27 Mar 2008 11:51 | |
| jason kirtland | 27 Mar 2008 12:01 | |
| Michael Bayer | 27 Mar 2008 12:10 | |
| Michael Bayer | 27 Mar 2008 12:42 | |
| Phillip J. Eby | 27 Mar 2008 14:06 | |
| jason kirtland | 27 Mar 2008 14:25 | |
| Phillip J. Eby | 27 Mar 2008 17:38 | |
| jason kirtland | 27 Mar 2008 18:08 | |
| Phillip J. Eby | 27 Mar 2008 21:54 | |
| Michael Bayer | 28 Mar 2008 06:44 | |
| Phillip J. Eby | 28 Mar 2008 07:57 | |
| Michael Bayer | 28 Mar 2008 08:37 | |
| jason kirtland | 28 Mar 2008 08:55 | |
| Phillip J. Eby | 28 Mar 2008 09:13 | |
| jason kirtland | 28 Mar 2008 09:26 | |
| Michael Bayer | 28 Mar 2008 09:28 | |
| Michael Bayer | 28 Mar 2008 09:53 |
| Subject: | [sqlalchemy] Re: Use of new_instance() in the user-defined-state branch?![]() |
|---|---|
| From: | Phillip J. Eby (pj...@telecommunity.com) |
| Date: | 03/27/2008 05:38:18 PM |
| List: | com.googlegroups.sqlalchemy |
At 02:26 PM 3/27/2008 -0700, jason kirtland wrote:
new_instance creates an instance without invoking __init__. The ORM uses it to recreate instances when loading from the database. new_instance can be added to InstrumentationManager as an extension method... The ORM doesn't care how empty instances are manufactured so long as they can be created without initialization arguments, e.g. a no-arg constructor.
Does that mean that no attributes must be set from new_instance(), either?
You should be able to set whatever you like there.
So... new_instance() could literally just be a call to 'self.class_()', with no other behavior, as long as the constructor requires no arguments? The modified __init__ that SA inserts won't be a problem there?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqla...@googlegroups.com
To unsubscribe from this group, send email to
sqla...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---




