mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Suppress rendering of binary data - thanks @russss (#442)
Binary columns (including spatialite geographies) get shown as ugly binary strings in the HTML by default. Nobody wants to see that mess. Show the size of the column in bytes instead. If you want to decode the binary data, you can use a plugin to do it.
This commit is contained in:
parent
bade9daeb2
commit
d555baf508
1 changed files with 2 additions and 0 deletions
|
|
@ -120,6 +120,8 @@ 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)))
|
||||
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