From 7b8010cf9fc201f26305279153501eeceb676d58 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 24 Jun 2026 18:01:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20update=20CRUD=E9=AA=8C=E8=AF=81=E8=B7=B3?= =?UTF-8?q?=E8=BF=87=E5=89=8D=E7=AB=AF=E6=9C=AA=E4=BC=A0=E7=9A=84=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=EF=BC=8C=E4=B8=8D=E5=81=9A=E5=90=88=E6=B3=95=E6=80=A7?= =?UTF-8?q?=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xls2ddl/tmpls.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xls2ddl/tmpls.py b/xls2ddl/tmpls.py index 10c3450..2f51ef1 100644 --- a/xls2ddl/tmpls.py +++ b/xls2ddl/tmpls.py @@ -374,12 +374,12 @@ _validation_rules = json.loads(r'''{{validation_rules}}''') import re as _re _errors = [] for _fname, _rules in _validation_rules.items(): -\t_val = params_kw.get(_fname, '') -\tif _val is None: _val = '' -\t_val = str(_val) -\t# Update: skip validation if field is empty (not modified) -\tif not _val or _val.strip() == '': +\tif _fname not in params_kw: \t\tcontinue +\t_val = params_kw.get(_fname) +\tif _val is None or str(_val).strip() == '': +\t\tcontinue +\t_val = str(_val) \tfor _rule in _rules: \t\t_rt = _rule.get('type', '') \t\t_rm = _rule.get('message', _fname)