Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-video-pipeline
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-video-pipeline
Commits
a436c02a
Commit
a436c02a
authored
Aug 02, 2017
by
Mushtaq Ali
Committed by
muzaffaryousaf
Oct 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add transcription process metadata to admin - EDUCATOR-1048
parent
bb41d96c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
14 deletions
+63
-14
VEDA_OS01/admin.py
+6
-1
VEDA_OS01/models.py
+57
-13
No files found.
VEDA_OS01/admin.py
View file @
a436c02a
...
@@ -2,7 +2,7 @@ from django.contrib import admin
...
@@ -2,7 +2,7 @@ from django.contrib import admin
from
VEDA_OS01.models
import
(
from
VEDA_OS01.models
import
(
Course
,
Video
,
Encode
,
URL
,
Destination
,
Institution
,
VedaUpload
,
Course
,
Video
,
Encode
,
URL
,
Destination
,
Institution
,
VedaUpload
,
TranscriptPreferences
TranscriptPreferences
,
TranscriptProcessMetadata
)
)
...
@@ -109,6 +109,10 @@ class TranscriptPreferencesAdmin(admin.ModelAdmin):
...
@@ -109,6 +109,10 @@ class TranscriptPreferencesAdmin(admin.ModelAdmin):
model
=
TranscriptPreferences
model
=
TranscriptPreferences
class
TranscriptProcessMetadataAdmin
(
admin
.
ModelAdmin
):
model
=
TranscriptProcessMetadata
admin
.
site
.
register
(
Course
,
CourseAdmin
)
admin
.
site
.
register
(
Course
,
CourseAdmin
)
admin
.
site
.
register
(
Video
,
VideoAdmin
)
admin
.
site
.
register
(
Video
,
VideoAdmin
)
admin
.
site
.
register
(
Encode
,
EncodeAdmin
)
admin
.
site
.
register
(
Encode
,
EncodeAdmin
)
...
@@ -117,3 +121,4 @@ admin.site.register(Destination, DestinationAdmin)
...
@@ -117,3 +121,4 @@ admin.site.register(Destination, DestinationAdmin)
admin
.
site
.
register
(
Institution
,
InstitutionAdmin
)
admin
.
site
.
register
(
Institution
,
InstitutionAdmin
)
admin
.
site
.
register
(
VedaUpload
,
VideoUploadAdmin
)
admin
.
site
.
register
(
VedaUpload
,
VideoUploadAdmin
)
admin
.
site
.
register
(
TranscriptPreferences
,
TranscriptPreferencesAdmin
)
admin
.
site
.
register
(
TranscriptPreferences
,
TranscriptPreferencesAdmin
)
admin
.
site
.
register
(
TranscriptProcessMetadata
,
TranscriptProcessMetadataAdmin
)
VEDA_OS01/models.py
View file @
a436c02a
...
@@ -10,6 +10,36 @@ def _createHex():
...
@@ -10,6 +10,36 @@ def _createHex():
return
uuid
.
uuid1
()
.
hex
return
uuid
.
uuid1
()
.
hex
class
TranscriptProvider
(
object
):
"""
3rd party transcript providers.
"""
THREE_PLAY
=
'3PlayMedia'
CIELO24
=
'Cielo24'
CHOICES
=
(
(
THREE_PLAY
,
THREE_PLAY
),
(
CIELO24
,
CIELO24
),
)
class
TranscriptStatus
(
object
):
"""
Transcript statuses.
"""
PENDING
=
'PENDING'
IN_PROGRESS
=
'IN PROGRESS'
FAILED
=
'FAILED'
READY
=
'READY'
CHOICES
=
(
(
PENDING
,
PENDING
),
(
IN_PROGRESS
,
IN_PROGRESS
),
(
FAILED
,
FAILED
),
(
READY
,
READY
)
)
class
Institution
(
models
.
Model
):
class
Institution
(
models
.
Model
):
institution_code
=
models
.
CharField
(
max_length
=
4
)
institution_code
=
models
.
CharField
(
max_length
=
4
)
institution_name
=
models
.
CharField
(
max_length
=
50
)
institution_name
=
models
.
CharField
(
max_length
=
50
)
...
@@ -431,19 +461,6 @@ class VedaUpload (models.Model):
...
@@ -431,19 +461,6 @@ class VedaUpload (models.Model):
)
)
class
TranscriptProvider
(
object
):
"""
3rd party transcript providers.
"""
THREE_PLAY
=
'3PlayMedia'
CIELO24
=
'Cielo24'
CHOICES
=
(
(
THREE_PLAY
,
THREE_PLAY
),
(
CIELO24
,
CIELO24
),
)
class
TranscriptPreferences
(
TimeStampedModel
):
class
TranscriptPreferences
(
TimeStampedModel
):
"""
"""
Model to contain third party transcription service provider preferances.
Model to contain third party transcription service provider preferances.
...
@@ -463,3 +480,30 @@ class TranscriptPreferences(TimeStampedModel):
...
@@ -463,3 +480,30 @@ class TranscriptPreferences(TimeStampedModel):
def
__unicode__
(
self
):
def
__unicode__
(
self
):
return
u'{org} - {provider}'
.
format
(
org
=
self
.
org
,
provider
=
self
.
provider
)
return
u'{org} - {provider}'
.
format
(
org
=
self
.
org
,
provider
=
self
.
provider
)
class
TranscriptProcessMetadata
(
TimeStampedModel
):
"""
Model to contain third party transcript process metadata.
"""
video
=
models
.
ForeignKey
(
Video
)
provider
=
models
.
CharField
(
'Transcript provider'
,
max_length
=
50
,
choices
=
TranscriptProvider
.
CHOICES
)
process_id
=
models
.
CharField
(
'Process id'
,
max_length
=
255
)
lang_code
=
models
.
CharField
(
'Language code'
,
max_length
=
3
)
status
=
models
.
CharField
(
'Transcript status'
,
max_length
=
50
,
choices
=
TranscriptStatus
.
CHOICES
,
default
=
TranscriptStatus
.
PENDING
)
class
Meta
:
unique_together
=
(
'video'
,
'provider'
,
'lang_code'
)
verbose_name_plural
=
'Transcript process metadata'
def
__unicode__
(
self
):
return
u'{video} - {provider} - {lang}'
.
format
(
video
=
self
.
video
.
edx_id
,
provider
=
self
.
provider
,
lang
=
self
.
lang_code
)
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