mirror of
				https://github.com/suyiiyii/nonebot-bison.git
				synced 2025-11-04 13:34:52 +08:00 
			
		
		
		
	🏷️ update type hints 3
This commit is contained in:
		
							parent
							
								
									202b8df0a6
								
							
						
					
					
						commit
						c84e3538bc
					
				@ -8,11 +8,12 @@ from pydantic import BaseModel
 | 
				
			|||||||
from nonebot_plugin_saa.registries import AllSupportedPlatformTarget
 | 
					from nonebot_plugin_saa.registries import AllSupportedPlatformTarget
 | 
				
			||||||
from nonebot.compat import PYDANTIC_V2, ConfigDict, model_dump, type_validate_json, type_validate_python
 | 
					from nonebot.compat import PYDANTIC_V2, ConfigDict, model_dump, type_validate_json, type_validate_python
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from ....types import Tag
 | 
					from nonebot_bison.types import Tag
 | 
				
			||||||
from ....types import Category
 | 
					from nonebot_bison.types import Category
 | 
				
			||||||
 | 
					from nonebot_bison.types import Target as T_Target
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from ..utils import NBESFParseErr
 | 
					from ..utils import NBESFParseErr
 | 
				
			||||||
from .base import NBESFBase, SubReceipt
 | 
					from .base import NBESFBase, SubReceipt
 | 
				
			||||||
from ....types import Target as T_Target
 | 
					 | 
				
			||||||
from ...db_model import Cookie as DBCookie
 | 
					from ...db_model import Cookie as DBCookie
 | 
				
			||||||
from ...db_config import SubscribeDupException, config
 | 
					from ...db_config import SubscribeDupException, config
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,6 @@
 | 
				
			|||||||
from ..db_model import Model
 | 
					from typing import Any
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from sqlalchemy.orm import DeclarativeBase
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class NBESFVerMatchErr(Exception): ...
 | 
					class NBESFVerMatchErr(Exception): ...
 | 
				
			||||||
@ -7,7 +9,7 @@ class NBESFVerMatchErr(Exception): ...
 | 
				
			|||||||
class NBESFParseErr(Exception): ...
 | 
					class NBESFParseErr(Exception): ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def row2dict(row: Model) -> dict:
 | 
					def row2dict(row: DeclarativeBase) -> dict[str, Any]:
 | 
				
			||||||
    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