blob: ed91f7328300561f2462cca468b9e1217eaea67a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
from django.db import models
from django.contrib.auth.models import User
from workshop_app.models import Profile
class Team(models.Model):
members = models.ManyToManyField(Profile)
creator = models.OneToOneField(User, on_delete=models.CASCADE)
created_date = models.DateTimeField(auto_now=True)
def __str__(self):
return f"Team created by {self.creator.get_full_name()}"
|