def build_query(self, kwargs): query = self.model.query.filter( self.year_column >= SQL_CONFIG['START_YEAR_ITEMIZED'], ) query = utils.filter_multi(query, kwargs, self.filter_multi_fields) query = utils.filter_range(query, kwargs, self.filter_range_fields) query = self.filter_fulltext(query, kwargs) return query
def _build_query(self, committee_id, kwargs): query = self.model.query if committee_id is not None: query = query.filter(self.model.committee_id == committee_id) query = utils.filter_multi(query, kwargs, self.fields) return query