Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
course-discovery
Commits
5e74ba3d
Commit
5e74ba3d
authored
Feb 23, 2018
by
Albert St. Aubin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added course_uuid to course run information
[LEARNER-4228]
parent
fbdb6d1f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
course_discovery/apps/api/serializers.py
+5
-1
No files found.
course_discovery/apps/api/serializers.py
View file @
5e74ba3d
...
...
@@ -505,6 +505,7 @@ class MinimalCourseRunSerializer(TimestampModelSerializer):
class
CourseRunSerializer
(
MinimalCourseRunSerializer
):
"""Serializer for the ``CourseRun`` model."""
course
=
serializers
.
SlugRelatedField
(
read_only
=
True
,
slug_field
=
'key'
)
course_uuid
=
serializers
.
SerializerMethodField
()
content_language
=
serializers
.
SlugRelatedField
(
read_only
=
True
,
slug_field
=
'code'
,
source
=
'language'
,
help_text
=
_
(
'Language in which the course is administered'
)
...
...
@@ -516,6 +517,9 @@ class CourseRunSerializer(MinimalCourseRunSerializer):
staff
=
PersonSerializer
(
many
=
True
)
level_type
=
serializers
.
SlugRelatedField
(
read_only
=
True
,
slug_field
=
'name'
)
def
get_course_uuid
(
self
,
obj
):
return
obj
.
course
.
uuid
@classmethod
def
prefetch_queryset
(
cls
,
queryset
=
None
):
queryset
=
super
()
.
prefetch_queryset
(
queryset
=
queryset
)
...
...
@@ -529,7 +533,7 @@ class CourseRunSerializer(MinimalCourseRunSerializer):
class
Meta
(
MinimalCourseRunSerializer
.
Meta
):
fields
=
MinimalCourseRunSerializer
.
Meta
.
fields
+
(
'course'
,
'full_description'
,
'announcement'
,
'video'
,
'seats'
,
'content_language'
,
'license'
,
'outcome'
,
'course'
,
'
course_uuid'
,
'
full_description'
,
'announcement'
,
'video'
,
'seats'
,
'content_language'
,
'license'
,
'outcome'
,
'transcript_languages'
,
'instructors'
,
'staff'
,
'min_effort'
,
'max_effort'
,
'weeks_to_complete'
,
'modified'
,
'level_type'
,
'availability'
,
'mobile_available'
,
'hidden'
,
'reporting_type'
,
'eligible_for_financial_aid'
,
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment