#7 Dodati su export/import za template, isto tako template za document

This commit is contained in:
2025-02-13 17:55:46 +01:00
parent 54ef0248f5
commit f41997fd59
12 changed files with 229 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ from django.contrib.auth.models import User
from django.db import models
from localflavor.br.br_states import STATE_CHOICES
from django.contrib import admin
import yaml
class UuidModel(models.Model):
@@ -124,6 +125,16 @@ class Document(models.Model):
content=content,
order=new_order
)
class DocumentTemplate(models.Model):
name = models.CharField(max_length=255, unique=True)
content = models.TextField(help_text="YAML format content")
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
def to_dict(self):
return yaml.safe_load(self.content)
class Risk(models.Model):