From ed354d86465a99871ed8c0a7edef643c0fd8994a Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Thu, 17 May 2012 18:14:19 -0500 Subject: [PATCH] db.table.field.avg(), issue 803, thanks Ato --- VERSION | 2 +- gluon/dal.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8abd600f..77c5d028 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-05-17 17:51:51) dev +Version 2.00.0 (2012-05-17 18:13:53) dev diff --git a/gluon/dal.py b/gluon/dal.py index 354384f2..9023cc88 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -7479,6 +7479,9 @@ class Expression(object): def len(self): return Expression(self.db, self.db._adapter.AGGREGATE, self, 'LENGTH', 'integer') + def avg(self): + return Expression(self.db, self.db._adapter.AGGREGATE, self, 'AVG', self.type) + def lower(self): return Expression(self.db, self.db._adapter.LOWER, self, None, self.type)