From cdb5db57f38d096f6893be9493e950d3d8ca37d0 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 3 Sep 2026 17:36:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(crud):=20get=E6=A8=A1=E6=9D=BF=E5=AF=B9conf?= =?UTF-8?q?idential=5Ffields=E8=84=B1=E6=95=8F=E2=80=94=E2=80=94=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E4=B8=8D=E5=86=8D=E5=9B=9E=E6=98=BE=E5=AF=86=E6=96=87?= =?UTF-8?q?(=E9=98=B2=E6=B3=84=E9=9C=B2+=E9=98=B2=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=8A=8A=E6=8E=A9=E7=A0=81=E5=BD=93=E5=80=BC?= =?UTF-8?q?=E5=9B=9E=E5=86=99)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xls2ddl/tmpls.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xls2ddl/tmpls.py b/xls2ddl/tmpls.py index f92a99d..ffee45e 100644 --- a/xls2ddl/tmpls.py +++ b/xls2ddl/tmpls.py @@ -203,7 +203,15 @@ debug(f'{sql=}') db = DBPools() dbname = get_module_dbname('{{modulename}}') async with db.sqlorContext(dbname) as sor: - r = await sor.sqlPaging(sql, ns) + r = await sor.sqlPaging(sql, ns) +{% if confidential_fields %} + _conf_fields = {{json.dumps(confidential_fields)}} + if r and r.get('rows'): + for _row in r['rows']: + for _cf in _conf_fields: + if _row.get(_cf): + _row[_cf] = '******' +{% endif %} return r return { "total":0,