Skip to content

Commit

Permalink
#18: Change to lte and gte
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranjprice101 committed Aug 15, 2019
1 parent 03f603c commit a9fb2fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/database_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ def apply_filter(self, query):
query.base_query = query.base_query.filter(getattr(query.table, self.field) == self.value)
elif self.operation == "like":
query.base_query = query.base_query.filter(getattr(query.table, self.field).like(f"%{self.value}%"))
elif self.operation == "lt":
elif self.operation == "lte":
query.base_query = query.base_query.filter(getattr(query.table, self.field) <= self.value)
elif self.operation == "gt":
elif self.operation == "gte":
query.base_query = query.base_query.filter(getattr(query.table, self.field) >= self.value)
else:
raise BadFilterError(f" Bad operation given to where filter. operation: {self.operation}")
Expand Down

0 comments on commit a9fb2fa

Please sign in to comment.