OK, if you are trying to select an object with the mapper, then you want to select it again and insure it is fresh from the DB, then you have to remove it from the identity map. Since you say the object isnt even present in the identity map, that means it definitely wasnt loaded by a mapper (unless you are clearing things out in between). I guess you are dealing with a newly constructed object and just want to reset its attributes ? Im not exactly sure what youre doing that it would matter (maybe a simplified version of your previous code would help me understand)...

anyway, if you have an object that is managed by a mapper, and you want to remove the attribute history, just do :

        objectstore.global_attributes.commit(obj)

or to roll back its attributes to what they were before modified:

        objectstore.global_attributes.rollback(obj)

but show me what youre trying to do again, a little more simply, so i can see what youre looking for.


--- mapping/objectstore.py      (revision 840)
+++ mapping/objectstore.py      (working copy)
@@ -159,7 +159,7 @@
         self.parent = parent

     def get(self, class_, *id):
-        return sqlalchemy.mapper.object_mapper(class_).get(*id)
+        return sqlalchemy.mapping.object_mapper(class_).get(*id)


yah, ill check that one in, thanks.




-------------------------------------------------------
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