From c67d95c92802c520d525ae2ae43f2be895668e38 Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Tue, 24 Jan 2012 21:15:20 -0600 Subject: [PATCH] string query and ingore_common_filters --- VERSION | 2 +- gluon/dal.py | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/VERSION b/VERSION index e5ed0b4e..3d8c6003 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.4 (2012-01-24 08:37:21) stable +Version 1.99.4 (2012-01-24 21:14:55) stable diff --git a/gluon/dal.py b/gluon/dal.py index 2acbc58d..76167408 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -1316,7 +1316,8 @@ class BaseAdapter(ConnectionPool): def _count(self, query, distinct=None): tablenames = self.tables(query) if query: - if not query.ignore_common_filters: + if hasattr(query,'ignore_common_filters') and \ + not query.ignore_common_filters: query = self.common_filter(query, tablenames) sql_w = ' WHERE ' + self.expand(query) else: @@ -3503,8 +3504,10 @@ class GoogleDatastoreAdapter(NoSQLAdapter): else: raise SyntaxError, "Unable to determine a tablename" - if query and not query.ignore_common_filters: - query = self.common_filter(query,[tablename]) + if query: + if hasattr(query,'ignore_common_filters') and \ + not query.ignore_common_filters: + query = self.common_filter(query,[tablename]) tableobj = self.db[tablename]._tableobj items = tableobj.all() @@ -4830,7 +4833,8 @@ class IMAPAdapter(NoSQLAdapter): rows """ - if not query.ignore_common_filters: + if hasattr(query,'ignore_common_filters') and \ + not query.ignore_common_filters: query = self.common_filter(query, [self.get_query_mailbox(query),]) # move this statement elsewhere (upper-level) @@ -5048,7 +5052,8 @@ class IMAPAdapter(NoSQLAdapter): def update(self, tablename, query, fields): # print "_update" - if not query.ignore_common_filters: + if hasattr(query,'ignore_common_filters') and \ + not query.ignore_common_filters: query = self.common_filter(query, [tablename,]) mark = [] @@ -5093,7 +5098,8 @@ class IMAPAdapter(NoSQLAdapter): counter = 0 tablename = self.get_query_mailbox(query) if query and tablename is not None: - if not query.ignore_common_filters: + if hasattr(query,'ignore_common_filters') and \ + not query.ignore_common_filters: query = self.common_filter(query, [tablename,]) # print "Selecting mailbox ..." result, data = self.connection.select(self.connection.mailbox_names[tablename]) @@ -5108,7 +5114,8 @@ class IMAPAdapter(NoSQLAdapter): counter = 0 if query: # print "Selecting mailbox ..." - if not query.ignore_common_filters: + if hasattr(query,'ignore_common_filters') and \ + not query.ignore_common_filters: query = self.common_filter(query, [tablename,]) result, data = self.connection.select(self.connection.mailbox_names[tablename]) # print "Retrieving sequence numbers remotely"