tl/scenes/models.py

26 lines
924 B
Python
Raw Normal View History

from django.conf import settings
from django.db import models
NTSC_24 = 24000 / 1001
class Project(models.Model):
"""One editing project: an uploaded OTIO source + the live mark-group scene
(tl.scene) the frontend reads and writes. The scene is just a JSON dump for
now — the whole {:tracks :groups} map the client keeps in app-db."""
owner = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE,
related_name="projects")
name = models.CharField(max_length=200)
otio = models.FileField(upload_to="otio/", blank=True, null=True)
fps = models.FloatField(default=NTSC_24)
scene = models.JSONField(default=dict, blank=True)
created = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
class Meta:
ordering = ["-updated"]
def __str__(self):
return f"{self.name} (#{self.pk})"