konova/user/models/team.py
mpeltriaux e8fae7a6f4 #101 Team settings
* adds first implementation for team managing
2022-02-17 13:13:32 +01:00

17 lines
549 B
Python

from django.db import models
from konova.models import UuidModel
class Team(UuidModel):
""" Groups users in self managed teams. Can be used for multi-sharing of data
"""
name = models.CharField(max_length=500, null=True, blank=True)
description = models.TextField(null=True, blank=True)
users = models.ManyToManyField("user.User", blank=True, related_name="teams")
admin = models.ForeignKey("user.User", blank=True, null=True, related_name="+", on_delete=models.SET_NULL)
def __str__(self):
return self.name