-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathmodels.py
26 lines (23 loc) · 885 Bytes
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from django.db import models
from django.contrib.contenttypes.models import ContentType
import django
try:
from django.contrib.contenttypes.fields import GenericForeignKey
except ImportError:
from django.contrib.contenttypes.generic import GenericForeignKey
class EncodeJob(models.Model):
STATE_CHOICES = (
(0, 'Submitted'),
(1, 'Progressing'),
(2, 'Error'),
(3, 'Warning'),
(4, 'Complete'),
)
id = models.CharField(max_length=100, primary_key=True)
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
state = models.PositiveIntegerField(choices=STATE_CHOICES, default=0, db_index=True)
content_object = GenericForeignKey()
message = models.TextField()
created_at = models.DateTimeField(auto_now_add=True)
last_modified = models.DateTimeField(auto_now=True)