Fix for colliding facet types bug, closes #625

Refs #830
This commit is contained in:
Simon Willison 2021-12-16 12:12:04 -08:00
commit 95d0dd7a1c
4 changed files with 67 additions and 52 deletions

View file

@ -668,7 +668,7 @@ Each Facet subclass implements a new type of facet operation. The class should l
async def facet_results(self):
# This should execute the facet operation and return results, again
# using self.sql and self.params as the starting point
facet_results = {}
facet_results = []
facets_timed_out = []
facet_size = self.get_facet_size()
# Do some calculations here...
@ -683,11 +683,11 @@ Each Facet subclass implements a new type of facet operation. The class should l
"toggle_url": self.ds.absolute_url(self.request, toggle_path),
"selected": selected,
})
facet_results[column] = {
facet_results.append({
"name": column,
"results": facet_results_values,
"truncated": len(facet_rows_results) > facet_size,
}
})
except QueryInterrupted:
facets_timed_out.append(column)