From add7055e0061b082cbc1a745217590fd5726bf44 Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Sun, 4 Dec 2011 17:51:39 -0600 Subject: [PATCH] minor improvement so that query is not modified --- VERSION | 2 +- gluon/dal.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 57745f85..d5d8a422 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.3 (2011-12-04 17:45:21) dev +Version 1.99.3 (2011-12-04 17:51:36) dev diff --git a/gluon/dal.py b/gluon/dal.py index 280fee45..01de6477 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -5829,13 +5829,14 @@ class Set(object): subset = set(db.users.id<5) """ - def __init__(self, db, query, ignore_common_filters = False): + def __init__(self, db, query, ignore_common_filters = None): self.db = db self._db = db # for backward compatibility - self.query = query - if query: - ### Some care here we shuld copy query but we are not for speed! + if query and not ignore_common_filters is None and \ + query.ignore_common_filters != ignore_common_filters: + query = copy.copy(query) query.ignore_common_filters = ignore_common_filters + self.query = query def __call__(self, query, ignore_common_filters=False): if isinstance(query,Table):