mirror of
https://github.com/boostorg/website-v2.git
synced 2026-02-24 04:32:08 +00:00
- 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
70 lines
2.1 KiB
Python
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",
|
|
},
|
|
),
|
|
]
|