Cache the table and remove CRUD tools included in mixins

This commit is contained in:
2023-02-11 15:44:20 +00:00
parent 5d6f96bbf3
commit 11d4542412
18 changed files with 513 additions and 725 deletions

View File

@@ -98,10 +98,11 @@ def make_graph(results):
class DrilldownTableView(SingleTableView):
table_class = DrilldownTable
template_name = "wm/widget.html"
template_name = "mixins/wm/widget.html"
window_content = "window-content/results.html"
# htmx_partial = "partials/"
paginate_by = settings.DRILLDOWN_RESULTS_PER_PAGE
widget_options = 'gs-w="10" gs-h="1" gs-y="10" gs-x="1"'
def common_request(self, request, **kwargs):
extra_params = {}
@@ -112,6 +113,7 @@ class DrilldownTableView(SingleTableView):
sizes = settings.MAIN_SIZES
if request.GET:
print("GET")
self.template_name = "index.html"
# GET arguments in URL like ?query=xyz
query_params = request.GET.dict()
@@ -119,6 +121,7 @@ class DrilldownTableView(SingleTableView):
if request.resolver_match.url_name == "search_partial":
self.template_name = "partials/results_table.html"
elif request.POST:
print("POST")
query_params = request.POST.dict()
else:
self.template_name = "index.html"
@@ -126,10 +129,12 @@ class DrilldownTableView(SingleTableView):
# Don't try to search, since there's clearly nothing to do
params_with_defaults = {}
add_defaults(params_with_defaults)
print("GOT TO CONTEXT")
context = {
"sizes": sizes,
"params": params_with_defaults,
"unique": "results",
"widget_options": self.widget_options,
"window_content": self.window_content,
"title": "Results",
}
@@ -187,6 +192,7 @@ class DrilldownTableView(SingleTableView):
# We don't want a random one since we only want one results pane.
context["unique"] = "results"
context["window_content"] = self.window_content
context["widget_options"] = self.widget_options
context["title"] = "Results"
# Valid sizes