use to_dict() here, so we can use |json in jscript
This commit is contained in:
7
path.py
7
path.py
@@ -63,6 +63,9 @@ class PathDetail(PA):
|
|||||||
# construct icon_url based on type of storage path (icons.svg contains icons for each)
|
# 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]
|
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
|
# helper function to find path details for move destinations - used in html
|
||||||
# for move DBox to show potential storage paths to move files into
|
# 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()
|
sps=Path.query.join(PathType).filter(PathType.name=="Storage").all()
|
||||||
for p in sps:
|
for p in sps:
|
||||||
obj = PathDetail( ptype="Storage", path=p.path_prefix.replace("static/Storage/","") )
|
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()
|
ips=Path.query.join(PathType).filter(PathType.name=="Import").all()
|
||||||
for p in ips:
|
for p in ips:
|
||||||
obj = PathDetail( ptype="Import", path=p.path_prefix.replace("static/Import/","") )
|
obj = PathDetail( ptype="Import", path=p.path_prefix.replace("static/Import/","") )
|
||||||
ret.append( obj )
|
ret.append( obj.to_dict() )
|
||||||
return ret
|
return ret
|
||||||
|
|||||||
Reference in New Issue
Block a user