铁科院功能模块
This commit is contained in:
18
app/models/function_list.py
Normal file
18
app/models/function_list.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from sqlalchemy import Column, BigInteger, String
|
||||
from ..core.database import Base
|
||||
|
||||
|
||||
class FunctionList(Base):
|
||||
"""铁科平台功能列表"""
|
||||
__tablename__ = "function_list"
|
||||
|
||||
id = Column(BigInteger, primary_key=True, index=True, autoincrement=True)
|
||||
function_name = Column(String(255), nullable=False, comment="功能名称")
|
||||
description = Column(String(1000), nullable=True, comment="描述")
|
||||
|
||||
def to_dict(self):
|
||||
"""将模型实例转换为字典"""
|
||||
return {
|
||||
column.name: getattr(self, column.name)
|
||||
for column in self.__table__.columns
|
||||
}
|
||||
Reference in New Issue
Block a user