Skip to content

Commit

Permalink
refactor: Pass kwargs into query class #268
Browse files Browse the repository at this point in the history
- This allows the `COUNT` keyword to be specified during a search API endpoint
  • Loading branch information
MRichards99 committed Jan 13, 2022
1 parent e0b54ea commit 34fa7d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions datagateway_api/src/search_api/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@


class SearchAPIQuery:
def __init__(self, panosc_entity_name):
def __init__(self, panosc_entity_name, **kwargs):
self.panosc_entity_name = panosc_entity_name
self.icat_entity_name = mappings.mappings[panosc_entity_name][
"base_icat_entity"
]

self.icat_query = ICATQuery(SessionHandler.client, self.icat_entity_name)
self.icat_query = ICATQuery(
SessionHandler.client, self.icat_entity_name, **kwargs,
)

def __repr__(self):
return (
Expand Down

0 comments on commit 34fa7d9

Please sign in to comment.