diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-06-26 19:55:48 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-06-26 19:55:48 +0000 |
commit | 49090a7a9434245b03a7f867add2401d3a78fead (patch) | |
tree | c22b55212f6a0b843be63d35cff3b4fbb5f39c5a /lib/sqlalchemy/attributes.py | |
parent | 22fcdbe81f528a584eb499b9dbf2270365926b71 (diff) | |
download | sqlalchemy-49090a7a9434245b03a7f867add2401d3a78fead.tar.gz |
fixed attribute manager's ability to traverse the full set of managed attributes for a descendant class, + 2 unit tests
Diffstat (limited to 'lib/sqlalchemy/attributes.py')
-rw-r--r-- | lib/sqlalchemy/attributes.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sqlalchemy/attributes.py b/lib/sqlalchemy/attributes.py index b7ad5249b..2bf336398 100644 --- a/lib/sqlalchemy/attributes.py +++ b/lib/sqlalchemy/attributes.py @@ -519,7 +519,7 @@ class AttributeHistory(object): else: self._deleted_items = [] self._unchanged_items = [] - #print "orig", original, "current", current, "added", self._added_items, "unchanged", self._unchanged_items, "deleted", self._deleted_items + #print "key", attr.key, "orig", original, "current", current, "added", self._added_items, "unchanged", self._unchanged_items, "deleted", self._deleted_items def __iter__(self): return iter(self._current) def added_items(self): @@ -566,7 +566,8 @@ class AttributeManager(object): """returns an iterator of all InstrumentedAttribute objects associated with the given class.""" if not isinstance(class_, type): raise repr(class_) + " is not a type" - for value in class_.__dict__.values(): + for key in dir(class_): + value = getattr(class_, key) if isinstance(value, InstrumentedAttribute): yield value |