from django.db import models class Member(models.Model): avatar = models.URLField() firstname = models.CharField(max_length=255, default='') lastname = models.CharField(max_length=255, default='') email = models.CharField(max_length=255, default='') number = models.CharField(max_length=255, default='') cell = models.ForeignKey("Cell") skills = models.ManyToManyField("Skill") projects = models.ManyToManyField("Project") def __str__(self): return self.firstname +' '+ self.lastname class Skill(models.Model): name = models.CharField(max_length=255, default='') def __str__(self): return self.name class Project(models.Model): name = models.CharField(max_length=255, default='') number = models.PositiveIntegerField(default='0') client = models.OneToOneField("Client") team = models.ManyToManyField("Member") def __str__(self): return self.name class Client(models.Model): name = models.CharField(max_length=255, default='') address = models.CharField(max_length=255, default='') logo = models.URLField() def __str__(self): return self.name class Cell(models.Model): name = models.CharField(max_length=255, default='') city = models.CharField(max_length=255, default='') country = models.CharField(max_length=255, default='') def __str__(self): return self.name class ChatRoom(models.Model): name = models.CharField(max_length=255, default='') description = models.CharField(max_length=255, default='') members = models.ManyToManyField("Member") owner = models.ForeignKey("Member", related_name="owned_chatrooms") def __str__(self): return self.name