完成极速成品和脚本优化

This commit is contained in:
Azmat@qq.com
2026-08-25 11:13:07 +08:00
parent 00fc454db7
commit e2ec2d14af
46 changed files with 4734 additions and 432 deletions
@@ -0,0 +1,92 @@
# Generated by Django 5.1.15 on 2026-08-24
import django.db.models.deletion
import uuid
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("accounts", "0009_team_price_multiplier"),
("projects", "0008_scripttemplate"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name="QuickCreateJob",
fields=[
("id", models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
("created_at", models.DateTimeField(auto_now_add=True)),
("updated_at", models.DateTimeField(auto_now=True)),
(
"status",
models.CharField(
choices=[
("queued", "Queued"),
("running", "Running"),
("succeeded", "Succeeded"),
("failed", "Failed"),
("cancelled", "Cancelled"),
],
default="queued",
max_length=24,
),
),
(
"phase",
models.CharField(
choices=[
("product", "Product"),
("script", "Script"),
("assets", "Assets"),
("production", "Storyboard and Video"),
("complete", "Complete"),
],
default="product",
max_length=24,
),
),
("progress", models.PositiveSmallIntegerField(default=0)),
("message", models.CharField(blank=True, max_length=255)),
("error_message", models.TextField(blank=True)),
("metadata", models.JSONField(blank=True, default=dict)),
("completed_at", models.DateTimeField(blank=True, null=True)),
(
"created_by",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="created_%(class)s_set",
to=settings.AUTH_USER_MODEL,
),
),
(
"project",
models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
related_name="quick_create_job",
to="projects.project",
),
),
(
"team",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="%(class)s_set",
to="accounts.team",
),
),
],
options={
"ordering": ["-created_at"],
"indexes": [
models.Index(fields=["team", "status", "-created_at"], name="projects_qu_team_id_a8a924_idx"),
models.Index(fields=["team", "phase"], name="projects_qu_team_id_98380e_idx"),
],
},
),
]