Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions content/migrations/0003_content_pipeline_state.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("content", "0002_content_newsletter_promotion"),
]

operations = [
migrations.AddField(
model_name="content",
name="pipeline_state",
field=models.CharField(
choices=[
("pending", "Pending"),
("processing", "Processing"),
("completed", "Completed"),
("awaiting_review", "Awaiting Review"),
("archived", "Archived"),
("duplicate", "Duplicate"),
],
db_index=True,
default="pending",
max_length=32,
),
),
]
17 changes: 17 additions & 0 deletions content/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ class FeedbackType(models.TextChoices):
DOWNVOTE = "downvote", "Downvote"


class ContentPipelineState(models.TextChoices):
"""High-level processing state for one content item in the AI pipeline."""

PENDING = "pending", "Pending"
PROCESSING = "processing", "Processing"
COMPLETED = "completed", "Completed"
AWAITING_REVIEW = "awaiting_review", "Awaiting Review"
ARCHIVED = "archived", "Archived"
DUPLICATE = "duplicate", "Duplicate"


class Content(models.Model):
"""Stores an ingested content item that may appear in a newsletter."""

Expand Down Expand Up @@ -47,6 +58,12 @@ class Content(models.Model):
duplicate_signal_count = models.IntegerField(default=0)
is_reference = models.BooleanField(default=False)
is_active = models.BooleanField(default=True)
pipeline_state = models.CharField(
max_length=32,
choices=ContentPipelineState.choices,
default=ContentPipelineState.PENDING,
db_index=True,
)
newsletter_promotion_at = models.DateTimeField(null=True, blank=True)
newsletter_promotion_by = models.ForeignKey(
settings.AUTH_USER_MODEL,
Expand Down
Loading
Loading