feat: add goal management section to student detail page

This commit is contained in:
hmo
2026-04-23 18:30:00 +08:00
parent c605c9732a
commit 9f22717adc
2 changed files with 165 additions and 1 deletions
+7
View File
@@ -39,11 +39,18 @@ def create_app():
app.register_blueprint(main_bp)
app.register_blueprint(templates_bp)
app.register_blueprint(goals_bp)
from app.routes import student_goals
app.register_blueprint(student_goals.student_goals_bp)
# 创建数据库和目录
with app.app_context():
os.makedirs(os.path.join(BASE_DIR, "data"), exist_ok=True)
os.makedirs(app.config["PDF_OUTPUT_DIR"], exist_ok=True)
# 确保所有模型都被导入
from app.models import Student, Problem, StudentProblem, Template, PracticePlan
from app.models import Goal, GoalRelation, StudentGoal # 新增目标相关模型
db.create_all()
# 简单迁移:为已存在的数据库添加新字段(必须在init_default_templates之前)