From 7c1f6c2195e04294acab860ba77137e93b33fd4b Mon Sep 17 00:00:00 2001 From: mdipierro Date: Mon, 4 Feb 2013 09:37:44 -0600 Subject: [PATCH] optional_args --- VERSION | 2 +- gluon/dal.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index de433d3e..012b9c25 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.4.1-alpha.2+timestamp.2013.02.04.09.27.30 +Version 2.4.1-alpha.2+timestamp.2013.02.04.09.37.03 diff --git a/gluon/dal.py b/gluon/dal.py index 90537466..0d94769d 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -1328,10 +1328,11 @@ class BaseAdapter(ConnectionPool): first = expression.first second = expression.second op = expression.op + optional_args = expression.optional_args or {} if not second is None: - return op(first, second) + return op(first, second, **optional_args) elif not first is None: - return op(first) + return op(first,**optional_args) elif isinstance(op, str): if op.endswith(';'): op=op[:-1] @@ -8560,6 +8561,7 @@ class Expression(object): first=None, second=None, type=None, + **optional_args ): self.db = db @@ -8572,6 +8574,7 @@ class Expression(object): self.type = first.type else: self.type = type + self.optional_args = optional_args def sum(self): db = self.db @@ -9279,12 +9282,14 @@ class Query(object): first=None, second=None, ignore_common_filters = False, + **optional_args ): self.db = self._db = db self.op = op self.first = first self.second = second self.ignore_common_filters = ignore_common_filters + self.optional_args = optional_args def __repr__(self): return '' % BaseAdapter.expand(self.db._adapter,self)