Fixed a whole bunch of broken base_url links

Refs #1519, #838
This commit is contained in:
Simon Willison 2021-11-19 16:52:33 -08:00
commit fe687fd020
6 changed files with 40 additions and 19 deletions

View file

@ -592,13 +592,15 @@ class DataView(BaseView):
)
it_can_render = await await_me_maybe(it_can_render)
if it_can_render:
renderers[key] = path_with_format(
request=request, format=key, extra_qs={**url_labels_extra}
renderers[key] = self.ds.urls.path(
path_with_format(
request=request, format=key, extra_qs={**url_labels_extra}
)
)
url_csv_args = {"_size": "max", **url_labels_extra}
url_csv = path_with_format(
request=request, format="csv", extra_qs=url_csv_args
url_csv = self.ds.urls.path(
path_with_format(request=request, format="csv", extra_qs=url_csv_args)
)
url_csv_path = url_csv.split("?")[0]
context = {

View file

@ -459,7 +459,7 @@ class QueryView(DataView):
"metadata": metadata,
"settings": self.ds.settings_dict(),
"request": request,
"show_hide_link": show_hide_link,
"show_hide_link": self.ds.urls.path(show_hide_link),
"show_hide_text": show_hide_text,
"show_hide_hidden": markupsafe.Markup(show_hide_hidden),
"hide_sql": hide_sql,

View file

@ -942,6 +942,7 @@ class TableView(RowTableShared):
"extra_wheres_for_ui": extra_wheres_for_ui,
"form_hidden_args": form_hidden_args,
"is_sortable": any(c["sortable"] for c in display_columns),
"fix_path": ds.urls.path,
"path_with_replaced_args": path_with_replaced_args,
"path_with_removed_args": path_with_removed_args,
"append_querystring": append_querystring,