summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2018-12-12 12:51:20 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2018-12-12 12:54:20 -0500
commitd4a130bb1b92869efe33675262c7b1fde364e477 (patch)
tree36c3d05f51ca8b5fa79a84bdefdb7a3c05093849 /lib/sqlalchemy
parent7206308e7fa6213b032ef4f7630dcb6aa460217c (diff)
downloadsqlalchemy-d4a130bb1b92869efe33675262c7b1fde364e477.tar.gz
Document and support nested composites
Composites can behave in a "nested" fashion by defining the class in that way. To make the constructor more convenient, a callable can be passed to :func:`.composite` instead of the class itself. This works now, so add a test to ensure this pattern remains available. Change-Id: Ia009f274fca7269f41d6d824e0f70b6fb0ada081
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/orm/descriptor_props.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/descriptor_props.py b/lib/sqlalchemy/orm/descriptor_props.py
index aaf53b698..3fefc5bba 100644
--- a/lib/sqlalchemy/orm/descriptor_props.py
+++ b/lib/sqlalchemy/orm/descriptor_props.py
@@ -100,7 +100,9 @@ class CompositeProperty(DescriptorProperty):
is the :class:`.CompositeProperty`.
:param class\_:
- The "composite type" class.
+ The "composite type" class, or any classmethod or callable which
+ will produce a new instance of the composite object given the
+ column values in order.
:param \*cols:
List of Column objects to be mapped.