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
d2906a9c
Commit
d2906a9c
authored
May 04, 2018
by
Matt Drayer
Committed by
Uman Shahzad
May 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include course image reference in serialized response
Co-authored-by: Uman Shahzad <uman@opencraft.com>
parent
5c17fa1e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
1 deletions
+6
-1
course_discovery/apps/api/serializers.py
+3
-1
course_discovery/apps/api/tests/test_serializers.py
+2
-0
course_discovery/apps/course_metadata/search_indexes.py
+1
-0
No files found.
course_discovery/apps/api/serializers.py
View file @
d2906a9c
...
...
@@ -600,7 +600,7 @@ class CourseSerializer(MinimalCourseSerializer):
fields
=
MinimalCourseSerializer
.
Meta
.
fields
+
(
'short_description'
,
'full_description'
,
'level_type'
,
'subjects'
,
'prerequisites'
,
'prerequisites_raw'
,
'expected_learning_items'
,
'video'
,
'sponsors'
,
'modified'
,
'marketing_url'
,
'syllabus_raw'
,
'outcome'
,
'original_image'
,
'original_image'
,
'card_image_url'
,
)
def
get_marketing_url
(
self
,
obj
):
...
...
@@ -1148,6 +1148,7 @@ class BaseHaystackFacetSerializer(HaystackFacetSerializer):
class
CourseSearchSerializer
(
HaystackSerializer
):
class
Meta
:
field_aliases
=
COMMON_SEARCH_FIELD_ALIASES
ignore_fields
=
COMMON_IGNORED_FIELDS
...
...
@@ -1157,6 +1158,7 @@ class CourseSearchSerializer(HaystackSerializer):
'key'
,
'short_description'
,
'title'
,
'card_image_url'
)
...
...
course_discovery/apps/api/tests/test_serializers.py
View file @
d2906a9c
...
...
@@ -165,6 +165,7 @@ class CourseSerializerTests(MinimalCourseSerializerTests):
'syllabus_raw'
:
course
.
syllabus_raw
,
'outcome'
:
course
.
outcome
,
'original_image'
:
ImageField
()
.
to_representation
(
course
.
original_image_url
),
'card_image_url'
:
course
.
card_image_url
,
})
return
expected
...
...
@@ -1266,6 +1267,7 @@ class CourseSearchSerializerTests(TestCase):
'full_description'
:
course
.
full_description
,
'content_type'
:
'course'
,
'aggregation_key'
:
'course:{}'
.
format
(
course
.
key
),
'card_image_url'
:
course
.
card_image_url
,
}
...
...
course_discovery/apps/course_metadata/search_indexes.py
View file @
d2906a9c
...
...
@@ -139,6 +139,7 @@ class CourseIndex(BaseCourseIndex, indexes.Indexable):
model
=
Course
uuid
=
indexes
.
CharField
(
model_attr
=
'uuid'
)
card_image_url
=
indexes
.
CharField
(
model_attr
=
'card_image_url'
,
null
=
True
)
org
=
indexes
.
CharField
()
course_runs
=
indexes
.
MultiValueField
()
expected_learning_items
=
indexes
.
MultiValueField
()
...
...
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