wd-smebiz/mods/cmebiz_rate/form_file/model.py

17 lines
741 B
Python
Raw Normal View History

2023-08-02 14:24:28 +08:00
from context.common import common_db
2023-08-02 10:18:36 +08:00
from sqlalchemy import Column, Integer, String, DateTime, func
class FormFile(common_db.Base):
__tablename__ = 'form_file'
md = Column(String(255), primary_key=True, comment='文件md')
file_name = Column(String(255), comment='文件名称')
mime_type = Column(String(255), comment='文件mime_type')
user_id = Column(String(255), comment='上传的用户id')
common_type = Column(String(255), comment='大分类的文件类型')
create_time = Column(DateTime, server_default=func.now(), comment='上传时间')
file_url = Column(String(500), comment='文件链接')
def to_dict(self):
return {c.name: getattr(self, c.name) for c in self.__table__.columns}