40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
import logging
|
|
|
|
from django.contrib.auth import get_user_model
|
|
from django.db import models
|
|
|
|
logger = logging.getLogger(__name__)
|
|
User = get_user_model()
|
|
|
|
|
|
class Film(models.Model):
|
|
created = models.DateTimeField(auto_now_add=True)
|
|
modified = models.DateTimeField(auto_now=True)
|
|
|
|
slug = models.SlugField()
|
|
public = models.BooleanField(default=False)
|
|
|
|
padma_id = models.CharField(max_length=255)
|
|
vimeo_id = models.CharField(max_length=255, default=None, null=True)
|
|
|
|
data = models.JSONField(default=dict, blank=True)
|
|
|
|
def __str__(self):
|
|
return self.data.get('title', self.slug)
|
|
|
|
|
|
class Edit(models.Model):
|
|
created = models.DateTimeField(auto_now_add=True)
|
|
modified = models.DateTimeField(auto_now=True)
|
|
|
|
slug = models.SlugField()
|
|
public = models.BooleanField(default=False)
|
|
|
|
padma_id = models.CharField(max_length=1024)
|
|
annotation_user = models.CharField(max_length=1024)
|
|
vimeo_id = models.CharField(max_length=255, default=None, null=True)
|
|
|
|
data = models.JSONField(default=dict, blank=True)
|
|
|
|
def __str__(self):
|
|
return self.data.get('title', self.slug)
|