(backend) add django-treebeard to allow tree structure on documents

We choose to use Django-treebeard for its quality, performance and
stability. Adding tree structure to documents is as simple as
inheriting from the MP_Node class.
This commit is contained in:
Samuel Paccoud - DINUM
2024-12-16 16:58:14 +01:00
committed by Anthony LC
parent 0189078917
commit 276b4f7c1b
12 changed files with 208 additions and 12 deletions

View File

@@ -287,7 +287,7 @@ class ServerCreateDocumentSerializer(serializers.Serializer):
{"content": ["Could not convert content"]}
) from err
document = models.Document.objects.create(
document = models.Document.add_root(
title=validated_data["title"],
content=document_content,
creator=user,