58 messages in com.googlegroups.sqlalchemy[sqlalchemy] Re: Integrating ORM with...| From | Sent On | Attachments |
|---|---|---|
| Phillip J. Eby | 26 Feb 2008 09:18 | |
| sdob...@sistechnology.com | 26 Feb 2008 10:36 | |
| Michael Bayer | 26 Feb 2008 11:05 | |
| Phillip J. Eby | 26 Feb 2008 11:42 | |
| Michael Bayer | 26 Feb 2008 12:27 | |
| Michael Bayer | 26 Feb 2008 12:28 | |
| sdob...@sistechnology.com | 26 Feb 2008 12:35 | |
| sdob...@sistechnology.com | 26 Feb 2008 13:05 | |
| jason kirtland | 26 Feb 2008 13:51 | |
| Phillip J. Eby | 26 Feb 2008 14:27 | |
| Phillip J. Eby | 26 Feb 2008 14:39 | |
| Michael Bayer | 26 Feb 2008 14:44 | |
| Michael Bayer | 26 Feb 2008 16:22 | |
| Phillip J. Eby | 26 Feb 2008 17:07 | |
| Phillip J. Eby | 26 Feb 2008 17:30 | |
| Michael Bayer | 26 Feb 2008 17:39 | |
| sdob...@sistechnology.com | 26 Feb 2008 22:05 | |
| Michael Bayer | 26 Feb 2008 23:48 | |
| sdob...@sistechnology.com | 26 Feb 2008 23:50 | |
| svilen | 27 Feb 2008 04:58 | |
| Judah De Paula | 27 Feb 2008 06:46 | |
| Michael Bayer | 27 Feb 2008 07:22 | |
| Michael Bayer | 27 Feb 2008 08:58 | .py |
| Judah De Paula | 27 Feb 2008 09:00 | |
| Judah De Paula | 27 Feb 2008 09:05 | |
| jason kirtland | 27 Feb 2008 09:19 | |
| Michael Bayer | 27 Feb 2008 09:40 | |
| Michael Bayer | 27 Feb 2008 10:06 | |
| Phillip J. Eby | 27 Feb 2008 12:10 | |
| Michael Bayer | 27 Feb 2008 13:03 | |
| Michael Bayer | 27 Feb 2008 13:09 | |
| sdob...@sistechnology.com | 27 Feb 2008 22:50 | |
| sdob...@sistechnology.com | 27 Feb 2008 23:20 | |
| Michael Bayer | 28 Feb 2008 07:18 | |
| Michael Bayer | 28 Feb 2008 13:16 | |
| Michael Bayer | 28 Feb 2008 13:19 | |
| sdob...@sistechnology.com | 28 Feb 2008 13:25 | |
| sdob...@sistechnology.com | 28 Feb 2008 13:38 | |
| sdob...@sistechnology.com | 28 Feb 2008 14:15 | |
| Phillip J. Eby | 28 Feb 2008 14:17 | |
| Phillip J. Eby | 28 Feb 2008 14:26 | |
| sdob...@sistechnology.com | 28 Feb 2008 14:37 | |
| Michael Bayer | 28 Feb 2008 14:41 | |
| Michael Bayer | 28 Feb 2008 14:48 | |
| sdob...@sistechnology.com | 28 Feb 2008 15:22 | |
| sdob...@sistechnology.com | 28 Feb 2008 15:38 | |
| Phillip J. Eby | 28 Feb 2008 16:15 | |
| Phillip J. Eby | 28 Feb 2008 16:26 | |
| sdob...@sistechnology.com | 28 Feb 2008 22:59 | |
| Phillip J. Eby | 29 Feb 2008 07:38 | |
| Michael Bayer | 29 Feb 2008 09:55 | .patch |
| Phillip J. Eby | 29 Feb 2008 10:44 | |
| Judah De Paula | 29 Feb 2008 11:08 | |
| Phillip J. Eby | 03 Mar 2008 10:38 | .patch |
| Michael Bayer | 03 Mar 2008 11:03 | |
| Phillip J. Eby | 04 Mar 2008 16:27 | |
| Michael Bayer | 05 Mar 2008 07:42 | |
| jason kirtland | 06 Mar 2008 14:41 |
| Subject: | [sqlalchemy] Re: Integrating ORM with classes that directly access __dict__ (was Re: Integrating the ORM with Trellis)![]() |
|---|---|
| From: | Michael Bayer (mike...@zzzcomputing.com) |
| Date: | 02/27/2008 09:40:27 AM |
| List: | com.googlegroups.sqlalchemy |
On Feb 27, 2008, at 12:00 PM, Judah De Paula wrote:
Yes, that's the code, and that's the problem. Proper OOP says I should not use your protected attribute ._state.modified, but I couldn't see an obvious work-around to get my objects to update using only the public interface. I have not tried yet, but it sounds like I can get things working again if I use ._state.committed_state[attr] instead?
err you can *try* but that might be a hard road to travel. when i did the copy-on-write refactoring i added a huge amount of unit tests to that whole system since it became more particular about how things are done..what decisions to make when theres no key present in committed_state, when theres no key in __dict__ but present in committed_state, etc. Also you're still dealing with internal things so you're not going to be stable.
Another issue with allowing direct __dict__ access is that you arent issuing any of the other attribute events SA needs. The "cascade" functionality, which does things like saves "B" when you say A.b = B, also drives off of events, as well as bidirectional relationships (i.e. backrefs) working themselves out. On the get side the whole ability to lazy load expired/deferred/unloaded attributes and collections drives off of the event system.
If you could take a look at the most recent thing I've done in the new branch and let me know if that meets your needs, that would be helpful. It seems like not, since you are dealing with C code that unconditionally writes straight to __dict__ and you cant use the normal event routes. Its possible you could fire off the normal SA events in the method illustrated in the example, which ultimately write to __dict__ anyway and it would just be a "double write" scenario, but not ultimately harmful.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---





.py