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
22bef6f9
Commit
22bef6f9
authored
Sep 17, 2014
by
David Ormsbee
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #25 from edx/ormsbee/admin_upgrade
Make the admin more usable.
parents
8735e39e
42b66160
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
6 deletions
+31
-6
edxval/admin.py
+27
-4
edxval/models.py
+4
-2
No files found.
edxval/admin.py
View file @
22bef6f9
...
@@ -5,8 +5,31 @@ Admin file for django app edxval.
...
@@ -5,8 +5,31 @@ Admin file for django app edxval.
from
django.contrib
import
admin
from
django.contrib
import
admin
from
.models
import
Video
,
Profile
,
EncodedVideo
,
Subtitle
,
CourseVideo
from
.models
import
Video
,
Profile
,
EncodedVideo
,
Subtitle
,
CourseVideo
admin
.
site
.
register
(
Video
)
admin
.
site
.
register
(
Profile
)
class
ProfileAdmin
(
admin
.
ModelAdmin
):
admin
.
site
.
register
(
EncodedVideo
)
list_display
=
(
'id'
,
'profile_name'
,
'extension'
,
'width'
,
'height'
)
list_display_links
=
(
'id'
,
'profile_name'
)
admin_order_field
=
'profile_name'
class
EncodedVideoInline
(
admin
.
TabularInline
):
model
=
EncodedVideo
class
CourseVideoInline
(
admin
.
TabularInline
):
model
=
CourseVideo
extra
=
0
verbose_name
=
"Course"
verbose_name_plural
=
"Courses"
class
VideoAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'id'
,
'edx_video_id'
,
'client_video_id'
,
'duration'
)
list_display_links
=
(
'id'
,
'edx_video_id'
)
search_fields
=
(
'id'
,
'edx_video_id'
,
'client_video_id'
)
list_per_page
=
50
admin_order_field
=
'edx_video_id'
inlines
=
[
CourseVideoInline
,
EncodedVideoInline
]
admin
.
site
.
register
(
Profile
,
ProfileAdmin
)
admin
.
site
.
register
(
Video
,
VideoAdmin
)
admin
.
site
.
register
(
Subtitle
)
admin
.
site
.
register
(
Subtitle
)
admin
.
site
.
register
(
CourseVideo
)
edxval/models.py
View file @
22bef6f9
...
@@ -57,6 +57,8 @@ class Profile(models.Model):
...
@@ -57,6 +57,8 @@ class Profile(models.Model):
width
=
models
.
PositiveIntegerField
()
width
=
models
.
PositiveIntegerField
()
height
=
models
.
PositiveIntegerField
()
height
=
models
.
PositiveIntegerField
()
def
__unicode__
(
self
):
return
self
.
profile_name
class
Video
(
models
.
Model
):
class
Video
(
models
.
Model
):
"""
"""
...
@@ -102,8 +104,8 @@ class CourseVideo(models.Model):
...
@@ -102,8 +104,8 @@ class CourseVideo(models.Model):
"""
"""
unique_together
=
(
"course_id"
,
"video"
)
unique_together
=
(
"course_id"
,
"video"
)
def
__
str
__
(
self
):
def
__
unicode
__
(
self
):
return
'
%
s for
%
s'
%
(
self
.
video
,
self
.
course_id
)
return
self
.
course_id
class
EncodedVideo
(
models
.
Model
):
class
EncodedVideo
(
models
.
Model
):
...
...
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