release: Elysia ToDo v1.0.0
鍏ㄦ爤涓汉淇℃伅绠$悊搴旂敤锛岄泦鎴愬緟鍔炰换鍔°€佷範鎯墦鍗°€佺邯蹇垫棩鎻愰啋銆佽祫浜ф€昏鍔熻兘銆 Made-with: Cursor
This commit is contained in:
16
api/app/models/category.py
Normal file
16
api/app/models/category.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from sqlalchemy import Column, Integer, String
|
||||
from sqlalchemy.orm import relationship
|
||||
from app.database import Base
|
||||
|
||||
|
||||
class Category(Base):
|
||||
"""分类模型"""
|
||||
__tablename__ = "categories"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
name = Column(String(100), nullable=False)
|
||||
color = Column(String(20), default="#FFB7C5") # 默认樱花粉
|
||||
icon = Column(String(50), default="folder") # 默认图标
|
||||
|
||||
# 关联关系
|
||||
tasks = relationship("Task", back_populates="category")
|
||||
Reference in New Issue
Block a user