From aa150974b50473dc600e72619f62168941389019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Fri, 18 Sep 2026 17:22:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=95=99=E8=82=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- college/models/course.py | 1 - college/models/course_import_wizard.py | 16 ++++++++-------- college/views/course_views.xml | 3 --- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/college/models/course.py b/college/models/course.py index 8ef6e9e..67aad2e 100644 --- a/college/models/course.py +++ b/college/models/course.py @@ -74,7 +74,6 @@ class SchoolCourse(models.Model): # 课程详情 introduction = fields.Html(string='课程介绍', sanitize=True) objectives = fields.Html(string='课程目标', sanitize=True) - syllabus = fields.Html(string='课程大纲', sanitize=True) features = fields.Html(string='课程特色', sanitize=True) business_scenario = fields.Html(string='业务情景', sanitize=True) diff --git a/college/models/course_import_wizard.py b/college/models/course_import_wizard.py index 9634616..752575a 100644 --- a/college/models/course_import_wizard.py +++ b/college/models/course_import_wizard.py @@ -64,7 +64,7 @@ class CourseImportWizard(models.TransientModel): '
  • 点击下方「下载模板」按钮下载 CSV 模板;
  • ' '
  • 用 Excel / WPS 打开模板,按示例填写数据:
    ' '课程名称、课程编号 为必填;
    ' - '所属学院、学期、课程类型、课时、课程大纲、业务情景 为选填;
  • ' + '所属学院、学期、课程类型、课时、课程介绍、业务情景 为选填;' '
  • 课程类型可选:理论 / 实践
  • ' '
  • 章节 / 任务(可选):填「章节标题」会自动建/复用章节,' '填「任务名称」会在该章节下建一条任务列表明细(是否完成填 是/否);' @@ -80,12 +80,12 @@ class CourseImportWizard(models.TransientModel): def action_download_template(self): """生成 CSV 模板并提供下载。""" header = ['课程名称', '课程编号', '所属学院', '学期', - '课程类型(理论/实践)', '课时', '课程大纲', '业务情景', + '课程类型(理论/实践)', '课时', '课程介绍', '业务情景', '章节标题', '章节说明', '章节课时', '任务名称', '是否完成'] sample = ['Python 编程基础', 'PY101', '计算机学院', '2025-2026第1学期', '理论', '48', - 'Python基础语法、数据结构、面向对象编程', + '本课程面向零基础学员,以项目驱动方式讲解核心知识', '通过电商订单管理场景贯穿课程', '第1章 环境搭建', '本章介绍开发环境', '4', '安装Python', '否'] @@ -183,9 +183,9 @@ class CourseImportWizard(models.TransientModel): vals['hours'] = int(float(hours_raw)) except ValueError: pass - syllabus = row.get('syllabus', '') - if syllabus: - vals['syllabus'] = syllabus + introduction = row.get('introduction', '') + if introduction: + vals['introduction'] = introduction business_scenario = row.get('business_scenario', '') if business_scenario: vals['business_scenario'] = business_scenario @@ -282,8 +282,8 @@ class CourseImportWizard(models.TransientModel): mapping[f] = 'course_type' elif f_lower in ('课时', 'hours'): mapping[f] = 'hours' - elif f_lower in ('课程大纲', 'syllabus', '大纲'): - mapping[f] = 'syllabus' + elif f_lower in ('课程介绍', 'introduction', '课程简介', '课程大纲', 'syllabus', '大纲'): + mapping[f] = 'introduction' elif f_lower in ('业务情景', 'business_scenario', 'scenario'): mapping[f] = 'business_scenario' elif f_lower in ('章节标题', 'chapter', '章节', 'chapter_name'): diff --git a/college/views/course_views.xml b/college/views/course_views.xml index 26b1473..99797fb 100644 --- a/college/views/course_views.xml +++ b/college/views/course_views.xml @@ -55,9 +55,6 @@ - - -