From 81ebf6fa01afda72ff871b2182e052f11355bc81 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sat, 4 Oct 2025 22:45:28 +1000 Subject: [PATCH] use to_dict() here, so we can use |json in jscript --- path.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/path.py b/path.py index 15d590c..f3834d2 100644 --- a/path.py +++ b/path.py @@ -63,6 +63,9 @@ class PathDetail(PA): # construct icon_url based on type of storage path (icons.svg contains icons for each) self.icon_url:str=url_for("internal", filename="icons.svg") + "#" + ICON[self.type] + def to_dict(self): + return {key: value for key, value in vars(self).items()} + ################################################################################ # helper function to find path details for move destinations - used in html # for move DBox to show potential storage paths to move files into @@ -83,9 +86,9 @@ def MovePathDetails(): sps=Path.query.join(PathType).filter(PathType.name=="Storage").all() for p in sps: obj = PathDetail( ptype="Storage", path=p.path_prefix.replace("static/Storage/","") ) - ret.append( obj ) + ret.append( obj.to_dict() ) ips=Path.query.join(PathType).filter(PathType.name=="Import").all() for p in ips: obj = PathDetail( ptype="Import", path=p.path_prefix.replace("static/Import/","") ) - ret.append( obj ) + ret.append( obj.to_dict() ) return ret