|
@@ -72,10 +72,10 @@ def record_matches(record, strict=None, **kwargs):
|
|
|
):
|
|
|
if not query:
|
|
|
continue
|
|
|
-
|
|
|
+
|
|
|
if key in strict and query != candidate:
|
|
|
return False
|
|
|
-
|
|
|
+
|
|
|
for term in query.split():
|
|
|
if term not in candidate:
|
|
|
return False
|
|
@@ -99,10 +99,11 @@ def unique_suggestions(cur, statement, name, display, exclude=NON_IDENTIFIER_COL
|
|
|
}
|
|
|
if len(ret) > 0 or name not in tables:
|
|
|
return ret
|
|
|
-
|
|
|
+
|
|
|
items = (i for i in filter(lambda x: record_matches(x, **{ name: kwargs[name] }),
|
|
|
- get_data(cur, get_table_statement(name), display)))
|
|
|
- return sorted(set(map(lambda x: x[name], items)))
|
|
|
+ get_data(cur, get_table_statement(name), display)))
|
|
|
+ ret = sorted(set(map(lambda x: x[name], items)))
|
|
|
+ return ret
|
|
|
|
|
|
def suggestions(cur, statement, name, display, exclude=NON_IDENTIFIER_COLUMNS, **kwargs):
|
|
|
exclude = filter(
|