Make build_query params all optional, more kwargy.

This commit is contained in:
voussoir 2017-09-23 11:22:05 -07:00
parent 855e94ed87
commit 0849796986
2 changed files with 12 additions and 8 deletions

View file

@ -725,12 +725,12 @@ class PDBPhotoMixin:
generator = [] generator = []
else: else:
query = searchhelpers.build_query( query = searchhelpers.build_query(
orderby,
notnulls,
minimums,
maximums,
author_ids=authors, author_ids=authors,
maximums=maximums,
minimums=minimums,
mmf_results=mmf_results, mmf_results=mmf_results,
notnulls=notnulls,
orderby=orderby,
) )
print(query[:200]) print(query[:200])
generator = helpers.select_generator(self.sql, query) generator = helpers.select_generator(self.sql, query)

View file

@ -7,13 +7,17 @@ from voussoirkit import expressionmatch
def build_query( def build_query(
orderby,
notnulls,
minimums,
maximums,
author_ids=None, author_ids=None,
maximums=None,
minimums=None,
mmf_results=None, mmf_results=None,
notnulls=None,
orderby=None,
): ):
if notnulls is None:
notnulls = set()
query = ['SELECT * FROM photos'] query = ['SELECT * FROM photos']
wheres = set() wheres = set()