mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-07-16 05:13:00 +08:00
♻️ 为 row2dict 添加类型注解
This commit is contained in:
parent
b60ba566de
commit
e6c45e5b1b
@ -1,10 +1,13 @@
|
|||||||
|
from ..db_model import Model
|
||||||
|
|
||||||
|
|
||||||
class NBESFVerMatchErr(Exception): ...
|
class NBESFVerMatchErr(Exception): ...
|
||||||
|
|
||||||
|
|
||||||
class NBESFParseErr(Exception): ...
|
class NBESFParseErr(Exception): ...
|
||||||
|
|
||||||
|
|
||||||
def row2dict(row):
|
def row2dict(row: Model) -> dict:
|
||||||
d = {}
|
d = {}
|
||||||
for column in row.__table__.columns:
|
for column in row.__table__.columns:
|
||||||
d[column.name] = str(getattr(row, column.name))
|
d[column.name] = str(getattr(row, column.name))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user