Make content follow the version

- store content per version
- root doc retrieval returns latest content
- updating content affects the latest version
- load metadata per version
This commit is contained in:
shamoon
2026-02-12 10:20:47 -08:00
parent 60e400fb68
commit 6a0fae67e9
10 changed files with 224 additions and 43 deletions

View File

@@ -1177,6 +1177,8 @@ class DocumentSerializer(
def to_representation(self, instance):
doc = super().to_representation(instance)
if "content" in self.fields and hasattr(instance, "effective_content"):
doc["content"] = getattr(instance, "effective_content") or ""
if self.truncate_content and "content" in self.fields:
doc["content"] = doc.get("content")[0:550]