Skip to content

Commit

Permalink
Merge branch 'master' into 2_add_include_and_order_filters
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranjprice101 authored Jul 22, 2019
2 parents d9716af + 457630e commit 3415ce5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions common/database_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,14 @@ def get_rows_by_filter(table, filters):
base_query = session.query(table)
includes_relation = False
for query_filter in filters:
if list(query_filter)[0].lower() == "where":
if len(query_filter) == 0:
pass
elif list(query_filter)[0].lower() == "where":
for key in query_filter:
where_part = query_filter[key]
for k in where_part:
column = getattr(table, k.upper())
base_query = base_query.filter(column.in_([where_part[k]]), column.in_([where_part[k]]))

elif list(query_filter)[0].lower() == "order":
for key in query_filter:
field = query_filter[key].split(" ")[0]
Expand Down

0 comments on commit 3415ce5

Please sign in to comment.