On Feb 1, 2006, at 9:16 AM, dmiller wrote:

Ok. I think I've figured this out. This works:
Index: lib/sqlalchemy/mapping/__init__.py
===================================================================
--- lib/sqlalchemy/mapping/__init__.py  (revision 879)
+++ lib/sqlalchemy/mapping/__init__.py  (working copy)
@@ -137,7 +137,7 @@
     if not isinstance(getattr(class_, '__init__'), types.MethodType):
         def __init__(self, **kwargs):
              for key, value in kwargs.items():
-                 self.__dict__[key] = value
+                 setattr(self, key, value)
         class_.__init__ = __init__
     m = mapper(class_, *args, **params)
     class_.mapper = m


ah ok, sorry i hadnt had a chance to test that constructor out, it was a recent addition. "setattr" in this case is telling the unit of work that "something changed" which sets off the backreference system, whereas straight self.__dict__[key] does not. i will commit this later today.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to