Commit 52f3c03d by Qubad786

Clean course model - EDUCATOR-1667

 - remove xue, mobile_override, project_ID, s3_dir
 - update course_name, course_hold, institute, class_id fields.
 - add deprecated todo to smesterid
parent 77d04caf
...@@ -20,7 +20,9 @@ class CourseAdmin(admin.ModelAdmin): ...@@ -20,7 +20,9 @@ class CourseAdmin(admin.ModelAdmin):
'institution', 'institution',
'edx_classid', 'edx_classid',
'last_vid_number', 'last_vid_number',
'previous_statechange' 'previous_statechange',
'created',
'modified',
] ]
list_filter = ['institution'] list_filter = ['institution']
search_fields = [ search_fields = [
......
...@@ -63,7 +63,6 @@ ...@@ -63,7 +63,6 @@
"tp_proc": false, "tp_proc": false,
"c24_proc": false, "c24_proc": false,
"s3_proc": true, "s3_proc": true,
"xue": true,
"local_storedir": "course-v1:VEDA+VEDA201+2015_T1", "local_storedir": "course-v1:VEDA+VEDA201+2015_T1",
"studio_hex": "xxxx" "studio_hex": "xxxx"
} }
......
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-11-08 07:14
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
('VEDA_OS01', '0003_auto_20171019_1317'),
]
operations = [
migrations.RemoveField(
model_name='course',
name='mobile_override',
),
migrations.RemoveField(
model_name='course',
name='parent_ID',
),
migrations.RemoveField(
model_name='course',
name='s3_dir',
),
migrations.RemoveField(
model_name='course',
name='xue',
),
migrations.AddField(
model_name='course',
name='created',
field=model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created'),
),
migrations.AddField(
model_name='course',
name='modified',
field=model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified'),
),
migrations.AlterField(
model_name='course',
name='course_hold',
field=models.BooleanField(default=True, help_text=b'Tells whether this course is active.', verbose_name=b'Course Active'),
),
migrations.AlterField(
model_name='course',
name='course_name',
field=models.CharField(help_text=b'Name of this course', max_length=255, verbose_name=b'Course Name'),
),
migrations.AlterField(
model_name='course',
name='edx_classid',
field=models.CharField(help_text=b'Course number to identify the course.', max_length=255, verbose_name=b'Class ID'),
),
migrations.AlterField(
model_name='course',
name='institution',
field=models.CharField(help_text=b'Organization of the course.', max_length=50, verbose_name=b'Inst. Code'),
),
]
...@@ -229,24 +229,32 @@ class Institution(models.Model): ...@@ -229,24 +229,32 @@ class Institution(models.Model):
) )
class Course(models.Model): class Course(TimeStampedModel):
""" """
Model for Course. Model to contain Studio course runs. Ideally, there should be one entry
in this Model for all the course runs in Studio.
""" """
course_name = models.CharField('Course Name', max_length=100) course_name = models.CharField('Course Name', help_text='Name of this course', max_length=255)
# TODO: Change Name (this is reversed) # TODO: Change Name (this is reversed)
course_hold = models.BooleanField('Course Active', default=False) course_hold = models.BooleanField(
institution = models.CharField('Inst. Code', max_length=4) 'Course Active',
edx_classid = models.CharField('Class ID', max_length=5) help_text='Tells whether this course is active.',
default=True
)
institution = models.CharField(
'Inst. Code',
help_text='Organization of the course.',
max_length=50
)
edx_classid = models.CharField(
'Class ID',
help_text='Course number to identify the course.',
max_length=255
)
# TODO: Create Default for 'this year' (e.g. 2017) # TODO deprecate semesterid.
semesterid = models.CharField('Semester', max_length=4) semesterid = models.CharField('Semester', max_length=4)
parent_ID = models.CharField(
'Parent Project',
max_length=8,
null=True, blank=True
)
previous_statechange = models.DateTimeField( previous_statechange = models.DateTimeField(
'Previous Data Statechange', 'Previous Data Statechange',
null=True, blank=True null=True, blank=True
...@@ -357,21 +365,6 @@ class Course(models.Model): ...@@ -357,21 +365,6 @@ class Course(models.Model):
# TODO: Change field name # TODO: Change field name
s3_proc = models.BooleanField('Process for AWS S3/Mobile?', default=True) s3_proc = models.BooleanField('Process for AWS S3/Mobile?', default=True)
# TODO: Deprecate (HLS) Replace
mobile_override = models.BooleanField(
'Low Bandwidth Override',
default=False
)
# TODO: Deprecate
s3_dir = models.CharField(
'S3 Directory',
max_length=50,
null=True, blank=True
)
# TODO: Change field name
xue = models.BooleanField('Submit to VAL', default=False)
# TODO: Change field name # TODO: Change field name
local_storedir = models.CharField( local_storedir = models.CharField(
'edX Studio URL (VAL)', 'edX Studio URL (VAL)',
......
...@@ -15,7 +15,6 @@ class CourseSerializer(serializers.ModelSerializer): ...@@ -15,7 +15,6 @@ class CourseSerializer(serializers.ModelSerializer):
'review_proc', 'review_proc',
'yt_proc', 'yt_proc',
's3_proc', 's3_proc',
'mobile_override',
'course_name', 'course_name',
'institution', 'institution',
'edx_classid', 'edx_classid',
...@@ -24,7 +23,9 @@ class CourseSerializer(serializers.ModelSerializer): ...@@ -24,7 +23,9 @@ class CourseSerializer(serializers.ModelSerializer):
'previous_statechange', 'previous_statechange',
'studio_hex', 'studio_hex',
'proc_loc', 'proc_loc',
'sg_projID' 'sg_projID',
'created',
'modified',
) )
def create(self, validated_data, partial=True): def create(self, validated_data, partial=True):
......
...@@ -361,8 +361,7 @@ class VedaDelivery: ...@@ -361,8 +361,7 @@ class VedaDelivery:
For now, old style workflow with checks and deletes at end For now, old style workflow with checks and deletes at end
""" """
if self.video_query.inst_class.s3_proc is False and \ if not self.video_query.inst_class.s3_proc:
self.video_query.inst_class.mobile_override is False:
return False return False
if self.video_proto.filesize < self.auth_dict['multi_upload_barrier']: if self.video_proto.filesize < self.auth_dict['multi_upload_barrier']:
......
...@@ -70,13 +70,10 @@ class VedaEncode(object): ...@@ -70,13 +70,10 @@ class VedaEncode(object):
self.encode_list.add(e) self.encode_list.add(e)
return None return None
if self.course_object.mobile_override is True:
for e in self.encode_dict['mobile_override']:
self.encode_list.add(e)
return None
for key, entry in self.encode_dict.iteritems(): for key, entry in self.encode_dict.iteritems():
if getattr(self.course_object, key) is True: # Adding default to avoid AttributeError on trying to get
# `mobile_override`, it is currently in `encode_dict`.
if getattr(self.course_object, key, False) is True:
if key != 'review_proc': if key != 'review_proc':
for e in entry: for e in entry:
self.encode_list.add(e) self.encode_list.add(e)
......
...@@ -267,7 +267,6 @@ class VEDACat(): ...@@ -267,7 +267,6 @@ class VEDACat():
setattr(c1, 'tp_proc', False) setattr(c1, 'tp_proc', False)
"""Always Set""" """Always Set"""
setattr(c1, 'xue', True)
setattr(c1, 'course_hold', True) # Remember, this is reversed setattr(c1, 'course_hold', True) # Remember, this is reversed
# Semester # Semester
......
...@@ -10,22 +10,21 @@ models_nottoget: ...@@ -10,22 +10,21 @@ models_nottoget:
- last_vid_number - last_vid_number
- previous_statechange - previous_statechange
- yt_proc - yt_proc
- s3_dir
- studio_hex - studio_hex
- sg_projID - sg_projID
- c24_hours - c24_hours
- created
- modified
#boolean (checkbox) #boolean (checkbox)
bools: bools:
- course_hold - course_hold
- proc_loc - proc_loc
- review_proc - review_proc
- mobile_override
- yt_proc - yt_proc
- tp_proc - tp_proc
- c24_proc - c24_proc
- s3_proc - s3_proc
- xue
# dropdown boxes # dropdown boxes
dropdowns: dropdowns:
...@@ -47,14 +46,11 @@ organizational: ...@@ -47,14 +46,11 @@ organizational:
institution: main institution: main
institution_name: main institution_name: main
edx_classid: main edx_classid: main
parent_ID: main
yt_proc: encode yt_proc: encode
s3_proc: encode s3_proc: encode
mobile_override: encode
review_proc: encode review_proc: encode
proc_loc: encode proc_loc: encode
xue: encode
yt_logon: encode yt_logon: encode
tp_proc: transcribe tp_proc: transcribe
......
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