Initial Daybook MVP
This commit is contained in:
commit
3974276c9b
25 changed files with 1647 additions and 0 deletions
39
artifacts/models.py
Normal file
39
artifacts/models.py
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
from django.db import models
|
||||
|
||||
|
||||
class Artifact(models.Model):
|
||||
HTML_FRAGMENT = "html_fragment"
|
||||
HTML_FULL = "html_full"
|
||||
MARKDOWN = "markdown"
|
||||
DECK = "deck"
|
||||
IMAGE = "image"
|
||||
PDF = "pdf"
|
||||
BINARY = "binary"
|
||||
|
||||
KIND_CHOICES = [
|
||||
(HTML_FRAGMENT, "HTML fragment"),
|
||||
(HTML_FULL, "Full HTML"),
|
||||
(MARKDOWN, "Markdown"),
|
||||
(DECK, "Deck"),
|
||||
(IMAGE, "Image"),
|
||||
(PDF, "PDF"),
|
||||
(BINARY, "Binary"),
|
||||
]
|
||||
|
||||
id = models.CharField(max_length=8, primary_key=True)
|
||||
persona = models.CharField(max_length=80, db_index=True)
|
||||
title = models.CharField(max_length=200)
|
||||
kind = models.CharField(max_length=20, choices=KIND_CHOICES)
|
||||
theme = models.CharField(max_length=40, blank=True)
|
||||
day = models.DateField(db_index=True)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
path = models.CharField(max_length=500)
|
||||
original_kind = models.CharField(max_length=20)
|
||||
tags = models.JSONField(default=list, blank=True)
|
||||
source_prompt = models.TextField(blank=True)
|
||||
|
||||
class Meta:
|
||||
ordering = ["-created_at"]
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.title} ({self.persona})"
|
||||
Loading…
Add table
Add a link
Reference in a new issue