]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Typo fix (thanks Ben!)
authorJason Kirtland <jek@discorporate.us>
Tue, 16 Oct 2007 21:11:39 +0000 (21:11 +0000)
committerJason Kirtland <jek@discorporate.us>
Tue, 16 Oct 2007 21:11:39 +0000 (21:11 +0000)
doc/build/content/mappers.txt

index 53dbaea2b42b00f89127ffec6ef2846c416191ca..70f5a1039983a6a3846eb430d903ffb69e9afe51 100644 (file)
@@ -1162,13 +1162,13 @@ There is no requirement to be list-, or set-like at all.  Collection classes can
 A `dict` can be used as a collection, but a keying strategy is needed to map entities loaded by the ORM to key, value pairs.  The [collections](rel:docstrings_sqlalchemy.orm.collections) package provides several built-in types for dictionary-based collections:
 
     {python}
-    from sqlalchemy.orm.collections import column_mapped_collection, attr_mapped_collection, mapped_collection
+    from sqlalchemy.orm.collections import column_mapped_collection, attribute_mapped_collection, mapped_collection
 
     mapper(Item, items_table, properties={
         # key by column
         notes = relation(Note, collection_class=column_mapped_collection(notes_table.c.keyword))
         # or named attribute 
-        notes2 = relation(Note, collection_class=attr_mapped_collection('keyword'))
+        notes2 = relation(Note, collection_class=attribute_mapped_collection('keyword'))
         # or any callable
         notes3 = relation(Note, collection_class=mapped_collection(lambda entity: entity.a + entity.b))
     })