fixed issue topic/web2py/UnN6AyOh2Lg thanks Paul

This commit is contained in:
mdipierro
2017-08-04 09:58:05 -05:00
parent 213c4ee7d1
commit b7270df9c3

View File

@@ -1939,11 +1939,13 @@ class SQLFORM(FORM):
if settings.global_settings.web2py_runtime_gae:
return reduce(lambda a,b: a|b, [field.contains(key) for field in sfields])
else:
if not (sfields and key and key.split()):
return fields[0].table
return reduce(lambda a,b:a&b,[
reduce(lambda a,b: a|b, [
field.contains(k) for field in sfields]
) for k in key.split()])
# from https://groups.google.com/forum/#!topic/web2py/hKe6lI25Bv4
# needs testing...
#words = key.split(' ') if key else []