Commit f62e3515 by Mushtaq Ali

add transcription process metadata to admin - EDUCATOR-1048

parent 9b9d5a65
......@@ -2,7 +2,7 @@ from django.contrib import admin
from VEDA_OS01.models import (
Course, Video, Encode, URL, Destination, Institution, VedaUpload,
TranscriptPreferences
TranscriptPreferences, TranscriptProcessMetadata
)
......@@ -107,6 +107,10 @@ class TranscriptPreferencesAdmin(admin.ModelAdmin):
model = TranscriptPreferences
class TranscriptProcessMetadataAdmin(admin.ModelAdmin):
model = TranscriptProcessMetadata
admin.site.register(Course, CourseAdmin)
admin.site.register(Video, VideoAdmin)
admin.site.register(Encode, EncodeAdmin)
......@@ -115,3 +119,4 @@ admin.site.register(Destination, DestinationAdmin)
admin.site.register(Institution, InstitutionAdmin)
admin.site.register(VedaUpload, VideoUploadAdmin)
admin.site.register(TranscriptPreferences, TranscriptPreferencesAdmin)
admin.site.register(TranscriptProcessMetadata, TranscriptProcessMetadataAdmin)
......@@ -10,6 +10,36 @@ def _createHex():
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):
institution_code = models.CharField(max_length=4)
institution_name = models.CharField(max_length=50)
......@@ -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):
"""
Model to contain third party transcription service provider preferances.
......@@ -463,3 +480,30 @@ class TranscriptPreferences(TimeStampedModel):
def __unicode__(self):
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
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment