mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
?_nofacets=1 option, closes #1350
This commit is contained in:
parent
f7d3e76fb3
commit
c5ae1197a2
4 changed files with 28 additions and 7 deletions
|
|
@ -731,13 +731,14 @@ class TableView(RowTableShared):
|
|||
)
|
||||
)
|
||||
|
||||
for facet in facet_instances:
|
||||
(
|
||||
instance_facet_results,
|
||||
instance_facets_timed_out,
|
||||
) = await facet.facet_results()
|
||||
facet_results.update(instance_facet_results)
|
||||
facets_timed_out.extend(instance_facets_timed_out)
|
||||
if not request.args.get("_nofacets"):
|
||||
for facet in facet_instances:
|
||||
(
|
||||
instance_facet_results,
|
||||
instance_facets_timed_out,
|
||||
) = await facet.facet_results()
|
||||
facet_results.update(instance_facet_results)
|
||||
facets_timed_out.extend(instance_facets_timed_out)
|
||||
|
||||
# Figure out columns and rows for the query
|
||||
columns = [r[0] for r in results.description]
|
||||
|
|
@ -828,6 +829,7 @@ class TableView(RowTableShared):
|
|||
self.ds.setting("suggest_facets")
|
||||
and self.ds.setting("allow_facet")
|
||||
and not _next
|
||||
and not request.args.get("_nofacets")
|
||||
):
|
||||
for facet in facet_instances:
|
||||
suggested_facets.extend(await facet.suggest())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue