symbiosy commited on
Commit
7b4aa9d
·
verified ·
1 Parent(s): 3c79311

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -73,8 +73,14 @@ def generate_key_value_table(attributes):
73
  """
74
  table_html = "<table border='1' style='border-collapse:collapse;width:100%;'>"
75
  table_html += "<tr><th>Attribute</th><th>Value</th></tr>"
 
 
76
  for key, value in attributes.items():
 
 
 
77
  table_html += f"<tr><td>{key}</td><td>{value}</td></tr>"
 
78
  table_html += "</table>"
79
  return table_html
80
 
 
73
  """
74
  table_html = "<table border='1' style='border-collapse:collapse;width:100%;'>"
75
  table_html += "<tr><th>Attribute</th><th>Value</th></tr>"
76
+
77
+ # Safely handle displaying values
78
  for key, value in attributes.items():
79
+ # Check if the value is a complex object
80
+ if isinstance(value, dict) or isinstance(value, list):
81
+ value = str(value) # Convert complex object to string
82
  table_html += f"<tr><td>{key}</td><td>{value}</td></tr>"
83
+
84
  table_html += "</table>"
85
  return table_html
86