diff options
| author | Charles Roelli <charles@aurox.ch> | 2026-05-15 13:15:04 +0000 |
|---|---|---|
| committer | Charles Roelli <charles@aurox.ch> | 2026-05-15 13:15:04 +0000 |
| commit | 431a34f195c6dff10c57c468694800c68d8399a5 (patch) | |
| tree | a0fd8eebbff5221d2f72c3f841a956a95642ce13 /docs/models.py | |
| parent | c7c0a47954663d1d8661f085b25c658817b5122d (diff) | |
Use the database for docs renderingissue-1630
Co-authored-by: Paolo Melchiorre <pmelchiorre@rippling.com>
Diffstat (limited to 'docs/models.py')
| -rw-r--r-- | docs/models.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/docs/models.py b/docs/models.py index 8dd7268c..3021a079 100644 --- a/docs/models.py +++ b/docs/models.py @@ -1,6 +1,5 @@ import datetime import html -import json import logging import operator from functools import partial, reduce @@ -111,6 +110,7 @@ class DocumentRelease(models.Model): limit_choices_to={"status": "f"}, on_delete=models.CASCADE, ) + global_context = models.JSONField(default=dict) is_default = models.BooleanField(default=False) objects = DocumentReleaseQuerySet.as_manager() @@ -469,7 +469,4 @@ class Document(models.Model): @cached_property def body(self): - """The document's body""" - with self.full_path.open() as fp: - doc = json.load(fp) - return doc["body"] + return self.metadata["body"] |
