summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/dynamic.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-08-22 18:21:25 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-08-22 18:21:25 +0000
commitd6fcdb5da02206b50cf8296496aff4c7d903e9b9 (patch)
tree21ac3d276ce636dbd91f5969d7a5efb5fbd288f2 /lib/sqlalchemy/orm/dynamic.py
parentd3917532bc9c2a37158596055028d95e710fff91 (diff)
downloadsqlalchemy-d6fcdb5da02206b50cf8296496aff4c7d903e9b9.tar.gz
- a "collection-holding" InstrumentedAttribute is now identified
by the presence of a "get_collection" method. - added "get_collection" to DynamicCollectionAttribute so its treated as a collection.
Diffstat (limited to 'lib/sqlalchemy/orm/dynamic.py')
-rw-r--r--lib/sqlalchemy/orm/dynamic.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/dynamic.py b/lib/sqlalchemy/orm/dynamic.py
index fe3628df2..1d4b5f6c9 100644
--- a/lib/sqlalchemy/orm/dynamic.py
+++ b/lib/sqlalchemy/orm/dynamic.py
@@ -21,7 +21,10 @@ class DynamicCollectionAttribute(attributes.InstrumentedAttribute):
# we have our own AttributeHistory therefore dont need CommittedState
# instead, we reset the history stored on the attribute
obj.__dict__[self.key] = CollectionHistory(self, obj)
-
+
+ def get_collection(self, obj, user_data=None):
+ return self.get_history(obj)._added_items
+
def set(self, obj, value, initiator):
if initiator is self:
return