kopia lustrzana https://github.com/simonw/datasette
Hacky way of adding to human description
rodzic
04c7fd6207
commit
af4ce463e7
|
@ -305,6 +305,7 @@ class TableView(RowTableShared):
|
|||
where_clauses, params = filters.build_where_clauses()
|
||||
|
||||
# Hacky thing for ?_m2m_ad_targets__target_id=9a8c6
|
||||
extra_human_descriptions = []
|
||||
for m2m_key in request.args:
|
||||
if m2m_key.startswith("_m2m_"):
|
||||
rest = m2m_key.split("_m2m_", 1)[1]
|
||||
|
@ -328,6 +329,9 @@ class TableView(RowTableShared):
|
|||
value=value,
|
||||
)
|
||||
)
|
||||
extra_human_descriptions.append(
|
||||
'{} contains "{}"'.format(m2m_table, value)
|
||||
)
|
||||
|
||||
# _search support:
|
||||
fts_table = info[name]["tables"].get(table, {}).get("fts_table")
|
||||
|
@ -744,6 +748,9 @@ class TableView(RowTableShared):
|
|||
[b for b in [human_description_en, sorted_by] if b]
|
||||
)
|
||||
|
||||
if extra_human_descriptions:
|
||||
human_description_en += " and ".join(extra_human_descriptions)
|
||||
|
||||
async def extra_template():
|
||||
display_columns, display_rows = await self.display_columns_and_rows(
|
||||
name,
|
||||
|
|
Ładowanie…
Reference in New Issue