From 3d7e7f31049fdabe5495619ba223d1ec6c9364f8 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 12 Apr 2021 16:12:39 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Create=20owner=20and=20collabora?= =?UTF-8?q?tors=20fields?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sophon/core/models.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sophon/core/models.py b/sophon/core/models.py index 5075a20..6fd4f84 100644 --- a/sophon/core/models.py +++ b/sophon/core/models.py @@ -1,5 +1,6 @@ from django.db import models from django.core import validators +from django.contrib.auth.models import User import pandas import pandasdmx import pandasdmx.message @@ -333,6 +334,19 @@ class Project(models.Model): default="INTERNAL", ) + owner = models.ForeignKey( + User, + help_text="The user who owns the project, and has full access to it.", + on_delete=models.CASCADE, + ) + + collaborators = models.ManyToManyField( + User, + help_text="The users who can edit the project.", + related_name="collaborates_in", + blank=True, + ) + flows = models.ManyToManyField( DataFlow, help_text="The DataFlows used in this project.",