]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
futher fix to the "orphan state" idea. to avoid setting tons of
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 1 Sep 2006 17:01:55 +0000 (17:01 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 1 Sep 2006 17:01:55 +0000 (17:01 +0000)
commit35e2f6680b17dcf0f65b4e392d2504bfe8000efb
tree6b155074e80a0972efad5e993ecf33ec497954bc
parent005603e2fb198c3f3328fa555e82a334f0f89d52
futher fix to the "orphan state" idea.  to avoid setting tons of
"hasparent" flags on objects as they are loaded, both from lazy and eager loads,
the "orphan" check now uses an "optimistic" flag to determine the result if no
"hasparent" flag is found for a particular relationship on an instance. if the
instance has an _instance_key and therefore was loaded from the database, it is
assumed to not be an orphan unless a "False" hasparent flag has been set.  if the
instance does not have an _instance_key and is therefore transient/pending, it is
assumed to be an orphan unless a "True" hasparent flag has been set.
CHANGES
lib/sqlalchemy/attributes.py
lib/sqlalchemy/orm/mapper.py
test/base/attributes.py
test/orm/mapper.py