feat: mo_data.py unified read layer (DB-first, JSON fallback) + cash_log table + batch JSON→DB migration (16 files)

This commit is contained in:
知微
2026-07-01 23:45:30 +08:00
parent 864d924012
commit 6305204c7a
52 changed files with 16351 additions and 11643 deletions
+2 -1
View File
@@ -2,12 +2,13 @@
"""Remove held stocks from watchlist"""
import json, os
from mo_data import read_portfolio, read_decisions, read_watchlist
WL = "/home/hmo/web-dashboard/data/watchlist.json"
DEC = "/home/hmo/web-dashboard/data/decisions.json"
holding_codes = set()
pf = json.load(open("/home/hmo/web-dashboard/data/portfolio.json"))
pf = mo_data.read_portfolio()
for h in pf.get("holdings", []):
c = h.get("code", "")
if c: