添加一些注释

This commit is contained in:
2026-09-23 12:23:41 +08:00
parent fc522c14c3
commit 8b26d3b239
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -14,7 +14,9 @@ def add_tea_dao(t,db):
if existing:
for key,value in t.items():
if hasattr(existing,key) and value is not None and value != '':
#hasattr(existing,key)统计有没有key,返回值是True或False
setattr(existing,key,value)
#将value的值赋值到existing的key中,配合循环,让所有输入的信息都覆盖原信息
existing.is_delete = False
db.commit()
return '恢复修改成功'