Skip to content

Commit

Permalink
Provide support for Django 2.0+
Browse files Browse the repository at this point in the history
  • Loading branch information
amir-qayyum-khan committed Jul 17, 2018
1 parent ced7792 commit 79b300e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dj_elastictranscoder/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import unicode_literals

from django.db import models, migrations
import django.db.models.deletion


class Migration(migrations.Migration):
Expand All @@ -20,7 +21,7 @@ class Migration(migrations.Migration):
('message', models.TextField()),
('created_at', models.DateTimeField(auto_now_add=True)),
('last_modified', models.DateTimeField(auto_now=True)),
('content_type', models.ForeignKey(to='contenttypes.ContentType')),
('content_type', models.ForeignKey(to='contenttypes.ContentType', on_delete=django.db.models.deletion.CASCADE)),
],
),
]
3 changes: 1 addition & 2 deletions dj_elastictranscoder/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from django.contrib.contenttypes.fields import GenericForeignKey



class EncodeJob(models.Model):
STATE_CHOICES = (
(0, 'Submitted'),
Expand All @@ -13,7 +12,7 @@ class EncodeJob(models.Model):
(4, 'Complete'),
)
id = models.CharField(max_length=100, primary_key=True)
content_type = models.ForeignKey(ContentType)
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
object_id = models.PositiveIntegerField()
state = models.PositiveIntegerField(choices=STATE_CHOICES, default=0, db_index=True)
content_object = GenericForeignKey()
Expand Down

0 comments on commit 79b300e

Please sign in to comment.