mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Unit test for binary data display, refs #442
This commit is contained in:
parent
d555baf508
commit
01b3de5b66
4 changed files with 41 additions and 2 deletions
|
|
@ -121,7 +121,9 @@ class RowTableShared(BaseView):
|
|||
if plugin_display_value is not None:
|
||||
display_value = plugin_display_value
|
||||
elif isinstance(value, bytes):
|
||||
display_value = jinja2.Markup("<{} bytes>".format(len(value)))
|
||||
display_value = jinja2.Markup("<Binary data: {} byte{}>".format(
|
||||
len(value), "" if len(value) == 1 else "s")
|
||||
)
|
||||
elif isinstance(value, dict):
|
||||
# It's an expanded foreign key - display link to other row
|
||||
label = value["label"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue