Minor improvements

This commit is contained in:
Miroslav Stampar
2019-11-14 14:21:53 +01:00
parent aa9ff9e8a6
commit 7e28c02948
6 changed files with 19 additions and 7 deletions

View File

@@ -4909,7 +4909,7 @@ def prioritySortColumns(columns):
"""
def _(column):
return column and "id" in column.lower()
return column and re.search(r"^id|id$", column, re.I) is not None
return sorted(sorted(columns, key=len), key=functools.cmp_to_key(lambda x, y: -1 if _(x) and not _(y) else 1 if not _(x) and _(y) else 0))