From 86f62b282b23206d4a5a8f824dabd3478127d14f Mon Sep 17 00:00:00 2001 From: eclipse Date: Tue, 15 Jul 2025 23:12:18 +0200 Subject: [PATCH] now showing only the first 50 characters of field contents --- the_works/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/the_works/models.py b/the_works/models.py index 9548a35..a188895 100644 --- a/the_works/models.py +++ b/the_works/models.py @@ -11,7 +11,8 @@ def _asdict(self): if type(col.type) == db.types.BLOB: d[col.key] = "Blob (NULL)" if self.__getattribute__(col.key) == None else f"Blob ({sys.getsizeof(self.__getattribute__(col.key))} Bytes)" else: - d[col.key] = self.__getattribute__(col.key) + value = str(self.__getattribute__(col.key)) + d[col.key] = value[:50] + '...' if len(value) > 50 else value return d db.Model._asdict = _asdict