]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
update address_count property
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 7 Aug 2011 18:05:00 +0000 (14:05 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 7 Aug 2011 18:05:00 +0000 (14:05 -0400)
doc/build/orm/mapper_config.rst

index 6acc99c06e7fedef955695866e1fc45fad85c7a7..df967ac392ba0b0499544b4904277990eb9cfd94 100644 (file)
@@ -484,8 +484,8 @@ transactional context from which to emit a statement::
         def address_count(self):
             return object_session(self).\
                 scalar(
-                    select([func.count(address_table.c.address_id)]).\
-                        where(address_table.c.user_id==self.user_id)
+                    select([func.count(Address.id)]).\
+                        where(Address.user_id==self.id)
                 )
 
 For more information on using descriptors, including how they can