A Project (owner, OTIO file, fps, scene JSON) persists the timeline. Session API: list projects, GET/PUT scene, serve OTIO. Admin manages users/projects; seed_demo creates a project from the bundled one_two_three.otio. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
25 lines
924 B
Python
25 lines
924 B
Python
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})"
|