Commit 1d29ea22 by Clinton Blackburn Committed by Clinton Blackburn

Added raw text fields for syllabus and prerequisites on Course model

Ultimately, Publisher will push to these fields since it is not updated to create structured data.

LEARNER-2720
parent 1bf912c7
......@@ -576,8 +576,8 @@ class CourseSerializer(MinimalCourseSerializer):
class Meta(MinimalCourseSerializer.Meta):
model = Course
fields = MinimalCourseSerializer.Meta.fields + (
'short_description', 'full_description', 'level_type', 'subjects', 'prerequisites',
'expected_learning_items', 'video', 'sponsors', 'modified', 'marketing_url',
'short_description', 'full_description', 'level_type', 'subjects', 'prerequisites', 'prerequisites_raw',
'expected_learning_items', 'video', 'sponsors', 'modified', 'marketing_url', 'syllabus_raw',
)
def get_marketing_url(self, obj):
......
......@@ -149,6 +149,8 @@ class CourseSerializerTests(MinimalCourseSerializerTests):
),
'course_runs': CourseRunSerializer(course.course_runs, many=True, context={'request': request}).data,
'owners': OrganizationSerializer(course.authoring_organizations, many=True).data,
'prerequisites_raw': course.prerequisites_raw,
'syllabus_raw': course.syllabus_raw,
})
return expected
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-10-02 17:05
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course_metadata', '0058_auto_course_about_page_creation_switch'),
]
operations = [
migrations.AddField(
model_name='course',
name='prerequisites_raw',
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name='course',
name='syllabus_raw',
field=models.TextField(blank=True, null=True),
),
]
......@@ -279,6 +279,8 @@ class Course(TimeStampedModel):
level_type = models.ForeignKey(LevelType, default=None, null=True, blank=True)
expected_learning_items = SortedManyToManyField(ExpectedLearningItem, blank=True)
outcome = models.TextField(blank=True, null=True)
prerequisites_raw = models.TextField(blank=True, null=True)
syllabus_raw = models.TextField(blank=True, null=True)
card_image_url = models.URLField(null=True, blank=True)
image = StdImageField(
upload_to=UploadToAutoSlug(populate_from='uuid', path='media/course/image'),
......
......@@ -69,6 +69,8 @@ class CourseFactory(factory.DjangoModelFactory):
card_image_url = FuzzyURL()
video = factory.SubFactory(VideoFactory)
partner = factory.SubFactory(PartnerFactory)
prerequisites_raw = FuzzyText()
syllabus_raw = FuzzyText()
class Meta:
model = Course
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment