Files
website-v2/core/migrations/0001_initial.py
Lacey Williams Henschel 825dbc019b Cache asciidoc content in db (Part of #394)
- Add RenderedContent model and related helper methods
- Change StaticContentView `get()` logic to try the cache, then the db, then S3
- Change StaticContentView to update db appropriately
- Refactoring for readability/maintainability
2023-06-09 14:43:05 -07:00

70 lines
2.1 KiB
Python

# Generated by Django 4.2.1 on 2023-06-09 04:20
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="RenderedContent",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"cache_key",
models.CharField(
db_index=True,
help_text="The cache key for the content.",
max_length=255,
unique=True,
),
),
(
"content_type",
models.CharField(
blank=True,
help_text="The content type/MIME type.",
max_length=255,
null=True,
),
),
(
"content_original",
models.TextField(
blank=True, help_text="The original content.", null=True
),
),
(
"content_html",
models.TextField(
blank=True, help_text="The rendered HTML content.", null=True
),
),
(
"last_updated_at",
models.DateTimeField(
blank=True,
help_text="The last time the content was updated in S3.",
null=True,
),
),
],
options={
"verbose_name": "rendered content",
"verbose_name_plural": "rendered contents",
},
),
]