Commit 0f139f51 by Brian Beggs

Merge pull request #55 from edx/ammar/upgrade-django-1.8

upgrade to django 1.8
parents 5db12411 ef0c5c8b
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Profile'
db.create_table('edxval_profile', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('profile_name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=50)),
('extension', self.gf('django.db.models.fields.CharField')(max_length=10)),
('width', self.gf('django.db.models.fields.PositiveIntegerField')()),
('height', self.gf('django.db.models.fields.PositiveIntegerField')()),
))
db.send_create_signal('edxval', ['Profile'])
# Adding model 'Video'
db.create_table('edxval_video', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('edx_video_id', self.gf('django.db.models.fields.CharField')(unique=True, max_length=50)),
('client_video_id', self.gf('django.db.models.fields.CharField')(max_length=255, db_index=True)),
('duration', self.gf('django.db.models.fields.FloatField')()),
))
db.send_create_signal('edxval', ['Video'])
# Adding model 'CourseVideo'
db.create_table('edxval_coursevideo', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('course_id', self.gf('django.db.models.fields.CharField')(max_length=255)),
('video', self.gf('django.db.models.fields.related.ForeignKey')(related_name='courses', to=orm['edxval.Video'])),
))
db.send_create_signal('edxval', ['CourseVideo'])
# Adding unique constraint on 'CourseVideo', fields ['course_id', 'video']
db.create_unique('edxval_coursevideo', ['course_id', 'video_id'])
# Adding model 'EncodedVideo'
db.create_table('edxval_encodedvideo', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
('url', self.gf('django.db.models.fields.URLField')(max_length=200)),
('file_size', self.gf('django.db.models.fields.PositiveIntegerField')()),
('bitrate', self.gf('django.db.models.fields.PositiveIntegerField')()),
('profile', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['edxval.Profile'])),
('video', self.gf('django.db.models.fields.related.ForeignKey')(related_name='encoded_videos', to=orm['edxval.Video'])),
))
db.send_create_signal('edxval', ['EncodedVideo'])
# Adding model 'Subtitle'
db.create_table('edxval_subtitle', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
('video', self.gf('django.db.models.fields.related.ForeignKey')(related_name='subtitles', to=orm['edxval.Video'])),
('fmt', self.gf('django.db.models.fields.CharField')(max_length=20, db_index=True)),
('language', self.gf('django.db.models.fields.CharField')(max_length=8, db_index=True)),
('content', self.gf('django.db.models.fields.TextField')(default='')),
))
db.send_create_signal('edxval', ['Subtitle'])
def backwards(self, orm):
# Removing unique constraint on 'CourseVideo', fields ['course_id', 'video']
db.delete_unique('edxval_coursevideo', ['course_id', 'video_id'])
# Deleting model 'Profile'
db.delete_table('edxval_profile')
# Deleting model 'Video'
db.delete_table('edxval_video')
# Deleting model 'CourseVideo'
db.delete_table('edxval_coursevideo')
# Deleting model 'EncodedVideo'
db.delete_table('edxval_encodedvideo')
# Deleting model 'Subtitle'
db.delete_table('edxval_subtitle')
models = {
'edxval.coursevideo': {
'Meta': {'unique_together': "(('course_id', 'video'),)", 'object_name': 'CourseVideo'},
'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'video': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'courses'", 'to': "orm['edxval.Video']"})
},
'edxval.encodedvideo': {
'Meta': {'object_name': 'EncodedVideo'},
'bitrate': ('django.db.models.fields.PositiveIntegerField', [], {}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'file_size': ('django.db.models.fields.PositiveIntegerField', [], {}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'profile': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['edxval.Profile']"}),
'url': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
'video': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'encoded_videos'", 'to': "orm['edxval.Video']"})
},
'edxval.profile': {
'Meta': {'object_name': 'Profile'},
'extension': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'height': ('django.db.models.fields.PositiveIntegerField', [], {}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'profile_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
'width': ('django.db.models.fields.PositiveIntegerField', [], {})
},
'edxval.subtitle': {
'Meta': {'object_name': 'Subtitle'},
'content': ('django.db.models.fields.TextField', [], {'default': "''"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'fmt': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'language': ('django.db.models.fields.CharField', [], {'max_length': '8', 'db_index': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'video': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'subtitles'", 'to': "orm['edxval.Video']"})
},
'edxval.video': {
'Meta': {'object_name': 'Video'},
'client_video_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
'duration': ('django.db.models.fields.FloatField', [], {}),
'edx_video_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
}
}
complete_apps = ['edxval']
\ No newline at end of file
from __future__ import unicode_literals
from django.db import models, migrations
import django.core.validators
import edxval.models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='CourseVideo',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('course_id', models.CharField(max_length=255)),
],
bases=(models.Model, edxval.models.ModelFactoryWithValidation),
),
migrations.CreateModel(
name='EncodedVideo',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', models.DateTimeField(auto_now_add=True)),
('modified', models.DateTimeField(auto_now=True)),
('url', models.CharField(max_length=200)),
('file_size', models.PositiveIntegerField()),
('bitrate', models.PositiveIntegerField()),
],
),
migrations.CreateModel(
name='Profile',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('profile_name', models.CharField(unique=True, max_length=50, validators=[django.core.validators.RegexValidator(regex=b'^[a-zA-Z0-9\\-_]*$', message=b'profile_name has invalid characters', code=b'invalid profile_name')])),
],
),
migrations.CreateModel(
name='Subtitle',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', models.DateTimeField(auto_now_add=True)),
('modified', models.DateTimeField(auto_now=True)),
('fmt', models.CharField(db_index=True, max_length=20, choices=[(b'srt', b'SubRip'), (b'sjson', b'SRT JSON')])),
('language', models.CharField(max_length=8, db_index=True)),
('content', models.TextField(default=b'')),
],
),
migrations.CreateModel(
name='Video',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', models.DateTimeField(auto_now_add=True)),
('edx_video_id', models.CharField(unique=True, max_length=100, validators=[django.core.validators.RegexValidator(regex=b'^[a-zA-Z0-9\\-_]*$', message=b'edx_video_id has invalid characters', code=b'invalid edx_video_id')])),
('client_video_id', models.CharField(db_index=True, max_length=255, blank=True)),
('duration', models.FloatField(validators=[django.core.validators.MinValueValidator(0)])),
('status', models.CharField(max_length=255, db_index=True)),
],
),
migrations.AddField(
model_name='subtitle',
name='video',
field=models.ForeignKey(related_name='subtitles', to='edxval.Video'),
),
migrations.AddField(
model_name='encodedvideo',
name='profile',
field=models.ForeignKey(related_name='+', to='edxval.Profile'),
),
migrations.AddField(
model_name='encodedvideo',
name='video',
field=models.ForeignKey(related_name='encoded_videos', to='edxval.Video'),
),
migrations.AddField(
model_name='coursevideo',
name='video',
field=models.ForeignKey(related_name='courses', to='edxval.Video'),
),
migrations.AlterUniqueTogether(
name='coursevideo',
unique_together=set([('course_id', 'video')]),
),
]
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
DEFAULT_PROFILES = [
"desktop_mp4",
"desktop_webm",
"mobile_high",
"mobile_low",
"youtube",
]
def create_default_profiles(apps, schema_editor):
""" Add default profiles """
Profile = apps.get_model("edxval", "Profile")
db_alias = schema_editor.connection.alias
for profile in DEFAULT_PROFILES:
Profile.objects.using(db_alias).get_or_create(profile_name=profile)
def delete_default_profiles(apps, schema_editor):
""" Remove default profiles """
Profile = apps.get_model("edxval", "Profile")
db_alias = schema_editor.connection.alias
Profile.objects.using(db_alias).filter(profile_name__in=DEFAULT_PROFILES).delete()
class Migration(migrations.Migration):
dependencies = [
('edxval', '0001_initial'),
]
operations = [
migrations.RunPython(create_default_profiles, delete_default_profiles),
]
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
orm.Profile.objects.bulk_create([
orm.Profile(profile_name="desktop_mp4", width=1280, height= 720, extension="mp4"),
orm.Profile(profile_name="desktop_webm", width=1280, height= 720, extension="webm"),
orm.Profile(profile_name="mobile_high", width= 960, height= 540, extension="mp4"),
orm.Profile(profile_name="mobile_low", width= 640, height= 360, extension="mp4"),
orm.Profile(profile_name="youtube", width=1920, height=1080, extension="mp4"),
])
# Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
def backwards(self, orm):
"Write your backwards methods here."
orm.Profile.objects.filter(
profile_name__in=["desktop_mp4", "desktop_webm", "mobile_high", "mobile_low", "youtube"]
).delete()
models = {
'edxval.coursevideo': {
'Meta': {'unique_together': "(('course_id', 'video'),)", 'object_name': 'CourseVideo'},
'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'video': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'courses'", 'to': "orm['edxval.Video']"})
},
'edxval.encodedvideo': {
'Meta': {'object_name': 'EncodedVideo'},
'bitrate': ('django.db.models.fields.PositiveIntegerField', [], {}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'file_size': ('django.db.models.fields.PositiveIntegerField', [], {}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'profile': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['edxval.Profile']"}),
'url': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
'video': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'encoded_videos'", 'to': "orm['edxval.Video']"})
},
'edxval.profile': {
'Meta': {'object_name': 'Profile'},
'extension': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'height': ('django.db.models.fields.PositiveIntegerField', [], {}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'profile_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
'width': ('django.db.models.fields.PositiveIntegerField', [], {})
},
'edxval.subtitle': {
'Meta': {'object_name': 'Subtitle'},
'content': ('django.db.models.fields.TextField', [], {'default': "''"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'fmt': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'language': ('django.db.models.fields.CharField', [], {'max_length': '8', 'db_index': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'video': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'subtitles'", 'to': "orm['edxval.Video']"})
},
'edxval.video': {
'Meta': {'object_name': 'Video'},
'client_video_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
'duration': ('django.db.models.fields.FloatField', [], {}),
'edx_video_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
}
}
complete_apps = ['edxval']
symmetrical = True
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Video.created'
db.add_column('edxval_video', 'created',
self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, default=datetime.datetime(2014, 11, 17, 0, 0), blank=True),
keep_default=False)
# Adding field 'Video.status'
db.add_column('edxval_video', 'status',
self.gf('django.db.models.fields.CharField')(default='File Complete', max_length=255, db_index=True),
keep_default=False)
# Changing field 'Video.edx_video_id'
db.alter_column('edxval_video', 'edx_video_id', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
# Changing field 'EncodedVideo.url'
db.alter_column('edxval_encodedvideo', 'url', self.gf('django.db.models.fields.CharField')(max_length=200))
def backwards(self, orm):
# Deleting field 'Video.created'
db.delete_column('edxval_video', 'created')
# Deleting field 'Video.status'
db.delete_column('edxval_video', 'status')
# Changing field 'Video.edx_video_id'
db.alter_column('edxval_video', 'edx_video_id', self.gf('django.db.models.fields.CharField')(max_length=50, unique=True))
# Changing field 'EncodedVideo.url'
db.alter_column('edxval_encodedvideo', 'url', self.gf('django.db.models.fields.URLField')(max_length=200))
models = {
'edxval.coursevideo': {
'Meta': {'unique_together': "(('course_id', 'video'),)", 'object_name': 'CourseVideo'},
'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'video': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'courses'", 'to': "orm['edxval.Video']"})
},
'edxval.encodedvideo': {
'Meta': {'object_name': 'EncodedVideo'},
'bitrate': ('django.db.models.fields.PositiveIntegerField', [], {}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'file_size': ('django.db.models.fields.PositiveIntegerField', [], {}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'profile': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['edxval.Profile']"}),
'url': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'video': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'encoded_videos'", 'to': "orm['edxval.Video']"})
},
'edxval.profile': {
'Meta': {'object_name': 'Profile'},
'extension': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'height': ('django.db.models.fields.PositiveIntegerField', [], {}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'profile_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
'width': ('django.db.models.fields.PositiveIntegerField', [], {})
},
'edxval.subtitle': {
'Meta': {'object_name': 'Subtitle'},
'content': ('django.db.models.fields.TextField', [], {'default': "''"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'fmt': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'language': ('django.db.models.fields.CharField', [], {'max_length': '8', 'db_index': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'video': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'subtitles'", 'to': "orm['edxval.Video']"})
},
'edxval.video': {
'Meta': {'object_name': 'Video'},
'client_video_id': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'duration': ('django.db.models.fields.FloatField', [], {}),
'edx_video_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'status': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'})
}
}
complete_apps = ['edxval']
\ No newline at end of file
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# The extension, width, and height fields of the Profile model are
# removed, but we want this migration to be non-destructive. Thus, the
# columns are simply altered to allow null values.
db.alter_column('edxval_profile', 'width', self.gf('django.db.models.fields.PositiveIntegerField')(null=True, default=1))
db.alter_column('edxval_profile', 'extension', self.gf('django.db.models.fields.CharField')(max_length=10, null=True, default='mp4'))
db.alter_column('edxval_profile', 'height', self.gf('django.db.models.fields.PositiveIntegerField')(null=True, default=1))
# On MySQL, attempts to insert new model instances (which lack values
# for the removed fields) results in a warning about a lack of a default
# value. Because django does not have a mechanism for specifying the
# default value in the database, we must manually alter the table here.
if db.backend_name == 'mysql':
db.execute("ALTER TABLE edxval_profile MODIFY extension VARCHAR(10) DEFAULT 'mp4'")
db.execute("ALTER TABLE edxval_profile MODIFY width INT(10) UNSIGNED DEFAULT 1")
db.execute("ALTER TABLE edxval_profile MODIFY height INT(10) UNSIGNED DEFAULT 1")
def backwards(self, orm):
# Remove database-level defaults applied above
if db.backend_name == 'mysql':
db.execute("ALTER TABLE edxval_profile MODIFY extension VARCHAR(10)")
db.execute("ALTER TABLE edxval_profile MODIFY width INT(10) UNSIGNED")
db.execute("ALTER TABLE edxval_profile MODIFY height INT(10) UNSIGNED")
# Because the forward migration is non-destructive and simply alters the
# extension, width, and height columns of the Profile model to allow
# null values, values from before the forward migration will still be
# present in the table. The backward migration restores the non-null
# restriction to each column and provides dumb defaults for any profiles
# that were created between the application of the forward migration and
# backward migration.
db.alter_column('edxval_profile', 'width', self.gf('django.db.models.fields.PositiveIntegerField')(default=1))
db.alter_column('edxval_profile', 'extension', self.gf('django.db.models.fields.CharField')(default='mp4', max_length=10))
db.alter_column('edxval_profile', 'height', self.gf('django.db.models.fields.PositiveIntegerField')(default=1))
models = {
'edxval.coursevideo': {
'Meta': {'unique_together': "(('course_id', 'video'),)", 'object_name': 'CourseVideo'},
'course_id': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'video': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'courses'", 'to': "orm['edxval.Video']"})
},
'edxval.encodedvideo': {
'Meta': {'object_name': 'EncodedVideo'},
'bitrate': ('django.db.models.fields.PositiveIntegerField', [], {}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'file_size': ('django.db.models.fields.PositiveIntegerField', [], {}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'profile': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['edxval.Profile']"}),
'url': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'video': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'encoded_videos'", 'to': "orm['edxval.Video']"})
},
'edxval.profile': {
'Meta': {'object_name': 'Profile'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'profile_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'})
},
'edxval.subtitle': {
'Meta': {'object_name': 'Subtitle'},
'content': ('django.db.models.fields.TextField', [], {'default': "''"}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'fmt': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'language': ('django.db.models.fields.CharField', [], {'max_length': '8', 'db_index': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'video': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'subtitles'", 'to': "orm['edxval.Video']"})
},
'edxval.video': {
'Meta': {'object_name': 'Video'},
'client_video_id': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'duration': ('django.db.models.fields.FloatField', [], {}),
'edx_video_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'status': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'})
}
}
complete_apps = ['edxval']
......@@ -128,10 +128,8 @@ INSTALLED_APPS = (
# 'django.contrib.admindocs',
# Third Party
'south',
'django_nose',
'rest_framework',
'debug_toolbar',
# Our App
'edxval',
......
......@@ -643,7 +643,7 @@ class GetVideoInfoTestWithHttpCalls(APIAuthTestCase):
"""
Tests number of queries for a Video/EncodedVideo(1) pair
"""
with self.assertNumQueries(8):
with self.assertNumQueries(6):
api.get_video_info(constants.COMPLETE_SET_FISH.get("edx_video_id"))
def test_get_info_queries_for_one_encoded_video(self):
......@@ -655,7 +655,7 @@ class GetVideoInfoTestWithHttpCalls(APIAuthTestCase):
url, constants.COMPLETE_SET_STAR, format='json'
)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
with self.assertNumQueries(6):
with self.assertNumQueries(5):
api.get_video_info(constants.COMPLETE_SET_STAR.get("edx_video_id"))
def test_get_info_queries_for_only_video(self):
......
......@@ -641,7 +641,7 @@ class VideoListTest(APIAuthTestCase):
Tests number of queries for a Video/EncodedVideo(2) pair
"""
url = reverse('video-list')
with self.assertNumQueries(17):
with self.assertNumQueries(15):
self.client.post(url, constants.COMPLETE_SET_FISH, format='json')
def test_queries_for_single_encoded_videos(self):
......@@ -649,7 +649,7 @@ class VideoListTest(APIAuthTestCase):
Tests number of queries for a Video/EncodedVideo(1) pair
"""
url = reverse('video-list')
with self.assertNumQueries(14):
with self.assertNumQueries(13):
self.client.post(url, constants.COMPLETE_SET_STAR, format='json')
......@@ -690,11 +690,11 @@ class VideoDetailTest(APIAuthTestCase):
self.client.get("/edxval/videos/").data
response = self.client.post(url, constants.COMPLETE_SET_FISH, format='json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
with self.assertNumQueries(14):
with self.assertNumQueries(12):
self.client.get("/edxval/videos/").data
response = self.client.post(url, constants.COMPLETE_SET_STAR, format='json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
with self.assertNumQueries(17):
with self.assertNumQueries(14):
self.client.get("/edxval/videos/").data
......
django>=1.4,<1.5
django>=1.8,<1.9
djangorestframework>=3.1,<3.2
enum34==1.0.4
lxml==3.3.6
South==1.0.1
-e git+https://github.com/edx/django-oauth2-provider.git@0.2.7-fork-edx-5#egg=django-oauth2-provider
-e git+https://github.com/edx/django-rest-framework-oauth.git@f0b503fda8c254a38f97fef802ded4f5fe367f7a#egg=djangorestframework-oauth
......@@ -2,7 +2,9 @@
from setuptools import setup
PACKAGES = [
'edxval'
'edxval',
'edxval.migrations',
'edxval.tests',
]
def is_requirement(line):
......@@ -37,7 +39,7 @@ def load_requirements(*requirements_paths):
setup(
name='edxval',
version='0.0.6',
version='0.0.8',
author='edX',
url='http://github.com/edx/edx-val',
description='edx-val',
......
......@@ -2,7 +2,6 @@ from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
......@@ -15,12 +14,3 @@ urlpatterns = patterns(
# edx-val
url(r'^edxval/', include('edxval.urls'))
)
# We need to do explicit setup of the Django debug toolbar because autodiscovery
# causes problems when you mix debug toolbar >= 1.0 + django < 1.7, and the
# admin uses autodiscovery. See:
# http://django-debug-toolbar.readthedocs.org/en/1.0/installation.html#explicit-setup
if settings.DEBUG:
urlpatterns += patterns('',
url(r'^__debug__/', include('debug_toolbar.urls')),
)
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