summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/attributes.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-03-25 21:44:42 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-03-25 21:44:42 +0000
commit995d9afb831ec72757781d5b48e5b4eee0bfac28 (patch)
tree48aae702f26658e78608410a7007418d07dcd491 /lib/sqlalchemy/attributes.py
parentf7afe052907c9343640e5e2569a47d62aa2328a5 (diff)
downloadsqlalchemy-995d9afb831ec72757781d5b48e5b4eee0bfac28.tar.gz
removed circular loop in creating new list elements, fixes a common refresh() condition
added None check in PropertyLoader many-to-one private deletion traversal, fixes byroot_tree (add a unit test for that)
Diffstat (limited to 'lib/sqlalchemy/attributes.py')
-rw-r--r--lib/sqlalchemy/attributes.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sqlalchemy/attributes.py b/lib/sqlalchemy/attributes.py
index bd5868baf..997b2c8f8 100644
--- a/lib/sqlalchemy/attributes.py
+++ b/lib/sqlalchemy/attributes.py
@@ -144,6 +144,8 @@ class ListElement(util.HistoryArraySet):
# list that might be set on the object already
try:
list_ = obj.__dict__[key]
+ if list_ is data:
+ raise InvalidArgumentError("Creating a list element passing the object's list as an argument")
if data is not None:
for d in data:
list_.append(d)
@@ -435,8 +437,7 @@ class AttributeManager(object):
elif not uselist:
return PropHistory(obj, key, **kwargs)
else:
- list_ = obj.__dict__.get(key, None)
- return self.create_list(obj, key, list_, **kwargs)
+ return self.create_list(obj, key, None, **kwargs)
def register_attribute(self, class_, key, uselist, callable_=None, **kwargs):
"""registers an attribute's behavior at the class level. This attribute