Skip to content

Commit

Permalink
#34: Add _get_table_to_filter method
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranjprice101 committed Aug 22, 2019
1 parent c8e85c4 commit ac2b923
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions common/database_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ def apply_filter(self, query):
query.base_query = query.base_query.filter(getattr(query.table, self.field) == self.value)


def _get_table_to_filter(self, query):
if type(query) is ISISInvestigationsQuery:
return INVESTIGATION
else:
return query.table

class OrderFilter(QueryFilter):
precedence = 1

Expand Down

0 comments on commit ac2b923

Please sign in to comment.