Skip to content

Commit

Permalink
#34: Add ISISInvestigationsCountQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranjprice101 committed Aug 22, 2019
1 parent 455bfdd commit 31677c3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions common/database_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,3 +440,12 @@ def get_investigations_for_user(user_id, filters):

finally:
query.session.close()

class ISISInvestigationsCountQuery(CountQuery):
"""
The query class used for /users/<:id>/investigations/count
"""

def __init__(self, user_id):
super().__init__(INVESTIGATIONUSER)
self.base_query = self.base_query.join(INVESTIGATION).filter(INVESTIGATIONUSER.USER_ID == user_id)

0 comments on commit 31677c3

Please sign in to comment.