summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJason Kirtland <jek@discorporate.us>2008-04-01 16:49:55 +0000
committerJason Kirtland <jek@discorporate.us>2008-04-01 16:49:55 +0000
commit1e0a91fe81cd8cf38603c7147ebf2e79301be6f5 (patch)
tree5b52e484432f16ba6dac119ff160513e1f12d5d7 /lib
parent73a4e9481d893426cedecaba57f06caea1894be1 (diff)
downloadsqlalchemy-1e0a91fe81cd8cf38603c7147ebf2e79301be6f5.tar.gz
- Tighten up r4399 _set_iterable docs
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/orm/attributes.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py
index f0b1510f9..a511c9bbb 100644
--- a/lib/sqlalchemy/orm/attributes.py
+++ b/lib/sqlalchemy/orm/attributes.py
@@ -586,18 +586,17 @@ class CollectionAttributeImpl(AttributeImpl):
lambda adapter, i: adapter.adapt_like_to_iterable(i))
def _set_iterable(self, state, iterable, adapter=None):
- """Set a collection value from an interable.
+ """Set a collection value from an iterable of state-bearers.
``adapter`` is an optional callable invoked with a CollectionAdapter
- and the iterable. Should return an iterable of instances suitable for
- appending via a CollectionAdapter. Can be used for, e.g., adapting an
- incoming dictionary iterable to a list.
+ and the iterable. Should return an iterable of state-bearing
+ instances suitable for appending via a CollectionAdapter. Can be used
+ for, e.g., adapting an incoming dictionary into an iterator of values
+ rather than keys.
"""
- # we need a CollectionAdapter to adapt the incoming value to an
- # assignable iterable. pulling a new collection first so that
- # an adaptation exception does not trigger a lazy load of the
- # old collection.
+ # pulling a new collection first so that an adaptation exception does
+ # not trigger a lazy load of the old collection.
new_collection, user_data = self._build_collection(state)
if adapter:
new_values = list(adapter(new_collection, iterable))