Merge pull request #301 from abmyii/more_find_operators

Implement additional find operators (and relevant tests)
This commit is contained in:
Friedrich Lindenberg
2020-01-11 12:43:29 +01:00
committed by GitHub
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -382,6 +382,8 @@ class Table(object):
key = list(value.keys())[0]
if key in ('like',):
clauses.append(self.table.c[column].like(value[key]))
elif key in ('ilike',):
clauses.append(self.table.c[column].ilike(value[key]))
elif key in ('>', 'gt'):
clauses.append(self.table.c[column] > value[key])
elif key in ('<', 'lt'):
@@ -390,6 +392,8 @@ class Table(object):
clauses.append(self.table.c[column] >= value[key])
elif key in ('<=', 'lte'):
clauses.append(self.table.c[column] <= value[key])
elif key in ('=', '==', 'is'):
clauses.append(self.table.c[column] == value[key])
elif key in ('!=', '<>', 'not'):
clauses.append(self.table.c[column] != value[key])
elif key in ('between', '..'):