Openedx - 创建课程时添加 Mongo 定义字段
Openedx - Adding Mongo Definition Field while creating course
我正在使用 Ironwood 版本并尝试添加字段“程序”。调用函数 create_course,我发现以下错误。
File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py", line 2007, in create_course
search_targets, root_category, root_block_id, **kwargs
File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py", line 2022, in _create_courselike
partitioned_fields = self.partition_fields_by_scope(root_category, fields)
File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/modulestore/__init__.py", line 1313, in partition_fields_by_scope
field = getattr(cls, field_name)
AttributeError: type object 'CourseDescriptorWithMixins' has no attribute 'program'
任何人都可以指导我缺少什么吗?
我遇到了同样的错误,当我将字段 'program' 添加到 common/lib/xmodule/xmodule/course_module.py[ 时问题得到解决=15=].
class CourseFields(object):
...
program = String(
display_name=_("Program"),
help=_("Specify the program of course."),
default=None,
scope=Scope.settings
)
...
我正在使用 Ironwood 版本并尝试添加字段“程序”。调用函数 create_course,我发现以下错误。
File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py", line 2007, in create_course
search_targets, root_category, root_block_id, **kwargs
File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py", line 2022, in _create_courselike
partitioned_fields = self.partition_fields_by_scope(root_category, fields)
File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/modulestore/__init__.py", line 1313, in partition_fields_by_scope
field = getattr(cls, field_name)
AttributeError: type object 'CourseDescriptorWithMixins' has no attribute 'program'
任何人都可以指导我缺少什么吗?
我遇到了同样的错误,当我将字段 'program' 添加到 common/lib/xmodule/xmodule/course_module.py[ 时问题得到解决=15=].
class CourseFields(object):
...
program = String(
display_name=_("Program"),
help=_("Specify the program of course."),
default=None,
scope=Scope.settings
)
...