mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Correct link to _ prefix on row page, closes #1525
This commit is contained in:
parent
69244a617b
commit
a37ee74891
3 changed files with 38 additions and 2 deletions
|
|
@ -1120,5 +1120,13 @@ class RowView(RowTableShared):
|
|||
count = (
|
||||
foreign_table_counts.get((fk["other_table"], fk["other_column"])) or 0
|
||||
)
|
||||
foreign_key_tables.append({**fk, **{"count": count}})
|
||||
key = fk["other_column"]
|
||||
if key.startswith("_"):
|
||||
key += "__exact"
|
||||
link = "{}?{}={}".format(
|
||||
self.ds.urls.table(database, fk["other_table"]),
|
||||
key,
|
||||
",".join(pk_values),
|
||||
)
|
||||
foreign_key_tables.append({**fk, **{"count": count, "link": link}})
|
||||
return foreign_key_tables
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue