添加一些注释
This commit is contained in:
@@ -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 '恢复修改成功'
|
||||
|
||||
Reference in New Issue
Block a user