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.
pull/447/head
Russ Garrett 2019-05-03 17:44:48 +01:00 zatwierdzone przez Simon Willison
rodzic bade9daeb2
commit d555baf508
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -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("<{}&nbsp;bytes>".format(len(value)))
elif isinstance(value, dict):
# It's an expanded foreign key - display link to other row
label = value["label"]