diff --git a/VERSION b/VERSION index c5823366..7ac93854 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.0.9 (2012-09-24 18:05:59) stable +Version 2.0.9 (2012-09-24 18:09:19) stable diff --git a/gluon/dal.py b/gluon/dal.py index db50179c..de27e6e7 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -2011,12 +2011,10 @@ class BaseAdapter(ConnectionPool): def CASE(self,query,t,f): def represent(x): + types = {type(True):'boolean',type(0):'integer',type(1.0):'double'} if x is None: return 'NULL' elif isinstance(x,Expression): return str(x) - types = {type(True): 'boolean', - type(0): 'integer', - type(1.0): 'double'} - return self.represent(x,types.get(type(x),'string')) + else: return self.represent(x,types.get(type(x),'string')) return Expression(self.db,'CASE WHEN %s THEN %s ELSE %s END' % \ (self.expand(query),represent(t),represent(f)))