Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-val
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
edx-val
Commits
ad8e4f31
Commit
ad8e4f31
authored
Oct 12, 2017
by
muzaffaryousaf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Update list_display for Course Video & Course Image.
- Use Django Form for Video image. EDU-1358
parent
0a9c8239
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
3 deletions
+36
-3
edxval/admin.py
+36
-3
No files found.
edxval/admin.py
View file @
ad8e4f31
"""
"""
Admin file for django app edxval.
Admin file for django app edxval.
"""
"""
from
django
import
forms
from
django.contrib
import
admin
from
django.contrib
import
admin
from
.models
import
(
CourseVideo
,
EncodedVideo
,
Profile
,
TranscriptPreference
,
from
.models
import
(
CourseVideo
,
EncodedVideo
,
Profile
,
TranscriptPreference
,
...
@@ -37,20 +37,53 @@ class VideoAdmin(admin.ModelAdmin): # pylint: disable=C0111
...
@@ -37,20 +37,53 @@ class VideoAdmin(admin.ModelAdmin): # pylint: disable=C0111
class
VideoImageAdmin
(
admin
.
ModelAdmin
):
class
VideoImageAdmin
(
admin
.
ModelAdmin
):
raw_id_fields
=
(
'course_video'
,
)
list_display
=
(
'get_course_video'
,
'image'
,
'generated_images'
)
def
get_course_video
(
self
,
obj
):
return
u'"{course_id}" -- "{edx_video_id}" '
.
format
(
course_id
=
obj
.
course_video
.
course_id
,
edx_video_id
=
obj
.
course_video
.
video
.
edx_video_id
)
get_course_video
.
admin_order_field
=
'course_video'
get_course_video
.
short_description
=
'Course Video'
model
=
VideoImage
model
=
VideoImage
verbose_name
=
'Video Image'
verbose_name
=
'Video Image'
verbose_name_plural
=
'Video Images'
verbose_name_plural
=
'Video Images'
class
CourseVideoAdmin
(
admin
.
ModelAdmin
):
class
CourseVideoAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'course_id'
,
'get_video_id'
,
'is_hidden'
)
def
get_video_id
(
self
,
obj
):
return
obj
.
video
.
edx_video_id
get_video_id
.
admin_order_field
=
'video'
get_video_id
.
short_description
=
'edX Video Id'
model
=
CourseVideo
model
=
CourseVideo
verbose_name
=
'Course Video'
verbose_name
=
'Course Video'
verbose_name_plural
=
'Course Videos'
verbose_name_plural
=
'Course Videos'
class
VideoTranscriptAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'video_id'
,
'language_code'
,
'provider'
,
'file_format'
)
model
=
VideoTranscript
class
TranscriptPreferenceAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'course_id'
,
'provider'
,
'video_source_language'
,
'preferred_languages'
)
model
=
TranscriptPreference
admin
.
site
.
register
(
Profile
,
ProfileAdmin
)
admin
.
site
.
register
(
Profile
,
ProfileAdmin
)
admin
.
site
.
register
(
Video
,
VideoAdmin
)
admin
.
site
.
register
(
Video
,
VideoAdmin
)
admin
.
site
.
register
(
VideoTranscript
)
admin
.
site
.
register
(
VideoTranscript
,
VideoTranscriptAdmin
)
admin
.
site
.
register
(
TranscriptPreference
)
admin
.
site
.
register
(
TranscriptPreference
,
TranscriptPreferenceAdmin
)
admin
.
site
.
register
(
VideoImage
,
VideoImageAdmin
)
admin
.
site
.
register
(
VideoImage
,
VideoImageAdmin
)
admin
.
site
.
register
(
CourseVideo
,
CourseVideoAdmin
)
admin
.
site
.
register
(
CourseVideo
,
CourseVideoAdmin
)
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