]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
register_deleted/register_dirty perform pre-check before doing the "validate" operati...
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 26 Feb 2006 19:15:43 +0000 (19:15 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 26 Feb 2006 19:15:43 +0000 (19:15 +0000)
CHANGES
lib/sqlalchemy/mapping/objectstore.py

diff --git a/CHANGES b/CHANGES
index 52b2846fffa229b9746c604080ca6d64ff899299..c85ad7820f3b7a92b7d504f0e2fb9f65bb7d04cd 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,10 @@ such as in an inheritance relationship, this is fixed.
 - overhaul to sql/schema packages so that the sql package can run all on its own,
 producing selects, inserts, etc. without any engine dependencies.  Table/Column
 are the "physical" subclasses of TableClause/ColumnClause.
+- fixes to mapper inheritance, involving properties that relate to the same table 
+involved in the mapper inheritance scheme
+- made objectstore "check for out-of-identitymap" more aggressive, will perform the
+check when object attributes are modified or the object is deleted
 0.1.2
 - fixed a recursive call in schema that was somehow running 994 times then returning
 normally.  broke nothing, slowed down everything.  thanks to jpellerin for finding this.
index 92052bd2861762ed9130816d2372e0f978e214bf..aed221be83fa828305f08ee39a45be3e63a3e970 100644 (file)
@@ -372,8 +372,9 @@ class UnitOfWork(object):
         self.new.append(obj)
         
     def register_dirty(self, obj):
-        self._validate_obj(obj)
-        self.dirty.append(obj)
+        if not self.dirty.contains(obj):
+            self._validate_obj(obj)
+            self.dirty.append(obj)
             
     def is_dirty(self, obj):
         if not self.dirty.contains(obj):
@@ -382,12 +383,13 @@ class UnitOfWork(object):
             return True
         
     def register_deleted(self, obj):
-        self._validate_obj(obj)
-        self.deleted.append(obj)  
-        mapper = object_mapper(obj)
-        # TODO: should the cascading delete dependency thing
-        # happen wtihin PropertyLoader.process_dependencies ?
-        mapper.register_deleted(obj, self)
+        if not self.deleted.contains(obj):
+            self._validate_obj(obj)
+            self.deleted.append(obj)  
+            mapper = object_mapper(obj)
+            # TODO: should the cascading delete dependency thing
+            # happen wtihin PropertyLoader.process_dependencies ?
+            mapper.register_deleted(obj, self)
 
     def unregister_deleted(self, obj):
         try: