Add Django backend: users, admin, OTIO + scene persistence
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>
This commit is contained in:
parent
7a960afb5c
commit
57ef570539
21 changed files with 406 additions and 0 deletions
25
scenes/models.py
Normal file
25
scenes/models.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
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})"
|
||||
Loading…
Add table
Add a link
Reference in a new issue