Commit c77a7f13 authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZSQLCatalog.SQLCatalog: Ignore unknown columns in getParams() instead (c6d26af5).

Selection.__call__() calls getParams() and as getParams() can be called
directly from many places (such as SelectionTool.getSelectionParamsFor()),
it makes more sense to have it here.
parent f6a79a1a
......@@ -207,10 +207,10 @@ class Selection(Acquisition.Implicit, Traversable, Persistent):
#LOG("Selection", 0, str(method))
#LOG('Selection', 0, "self.invert_mode = %s" % repr(self.invert_mode))
if not params:
kw = self.params.copy()
kw = self.getParams()
else:
kw = params.copy()
kw.setdefault("ignore_unknown_columns", True)
kw.setdefault("ignore_unknown_columns", True)
# Always remove '-C'-named parameter.
kw.pop('-C', None)
if self.invert_mode is not 0:
......@@ -280,7 +280,10 @@ class Selection(Acquisition.Implicit, Traversable, Persistent):
"""
if not isinstance(self.params, dict):
self.params = {}
return self.params.copy()
params = self.params.copy()
params.setdefault("ignore_unknown_columns", True)
return params
security.declarePublic('getSortOrder')
def getSortOrder(self):
......
......@@ -74,7 +74,7 @@ class TestSelectionTool(ERP5TypeTestCase):
self.assertEqual('test_selection', selection.name)
def testGetSelectionParamsFor(self):
self.assertEqual({'key':'value'},
self.assertEqual({'key':'value', 'ignore_unknown_columns': True},
self.portal_selections.getSelectionParamsFor('test_selection'))
def testGetSelectionParamsDictInterface(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment