33 lines
1010 B
Python
33 lines
1010 B
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
"""
|
|
大屏素材数据模型
|
|
"""
|
|
from sqlalchemy import Column, String
|
|
|
|
from app.base_model import BaseModel
|
|
|
|
|
|
class ScreenMaterialCategory(BaseModel):
|
|
"""大屏素材分类"""
|
|
__tablename__ = "screen_material_category"
|
|
|
|
name = Column(String(50), nullable=False, comment="分类名称")
|
|
code = Column(String(50), unique=True, index=True, nullable=False, comment="分类编码")
|
|
icon = Column(String(50), default='Image', comment="图标名称")
|
|
|
|
def __repr__(self):
|
|
return f"<ScreenMaterialCategory {self.name}>"
|
|
|
|
|
|
class ScreenMaterial(BaseModel):
|
|
"""大屏素材"""
|
|
__tablename__ = "screen_material"
|
|
|
|
category_id = Column(String(32), nullable=True, index=True, comment="分类ID")
|
|
name = Column(String(100), nullable=False, comment="素材名称")
|
|
file_id = Column(String(32), nullable=True, comment="文件ID(关联文件管理器)")
|
|
|
|
def __repr__(self):
|
|
return f"<ScreenMaterial {self.name}>"
|