#7 Dodati su export/import za template, isto tako template za document
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user