]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
need an "alias()" on map to a select
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 6 Mar 2007 18:39:27 +0000 (18:39 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 6 Mar 2007 18:39:27 +0000 (18:39 +0000)
doc/build/content/adv_datamapping.txt

index d6102b424afcc1a9e8ea9111c041af9212abebd5..585ac5990a1537915ce6e76ecfd3f3981f7573e6 100644 (file)
@@ -590,7 +590,7 @@ A second example:
 
 In both examples above, "composite" columns were added as properties to the mappers; these are aggregations of multiple columns into one mapper property, which instructs the mapper to keep both of those columns set at the same value.
 
-### Mapping a Class against Arbitary Selects {@name=selects}
+### Mapping a Class against Arbitrary Selects {@name=selects}
 
 Similar to mapping against a join, a plain select() object can be used with a mapper as well.  Below, an example select which contains two aggregate functions and a group_by is mapped to a class:
 
@@ -600,7 +600,7 @@ Similar to mapping against a join, a plain select() object can be used with a ma
                 func.max(orders.price).label('highest_order')],
                 customers.c.customer_id==orders.c.customer_id,
                 group_by=[c for c in customers.c]
-                )
+                ).alias('somealias')
     class Customer(object):
         pass