From e6c45e5b1b5f8cf4f10bd3084f5ca4ad13ebf4d7 Mon Sep 17 00:00:00 2001 From: suyiiyii Date: Mon, 28 Oct 2024 23:56:10 +0800 Subject: [PATCH] =?UTF-8?q?:recycle:=20=E4=B8=BA=20row2dict=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=B1=BB=E5=9E=8B=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_bison/config/subs_io/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nonebot_bison/config/subs_io/utils.py b/nonebot_bison/config/subs_io/utils.py index c862b78..1ba7558 100644 --- a/nonebot_bison/config/subs_io/utils.py +++ b/nonebot_bison/config/subs_io/utils.py @@ -1,10 +1,13 @@ +from ..db_model import Model + + class NBESFVerMatchErr(Exception): ... class NBESFParseErr(Exception): ... -def row2dict(row): +def row2dict(row: Model) -> dict: d = {} for column in row.__table__.columns: d[column.name] = str(getattr(row, column.name))