hubl/src/server/models.py

61 lines
1.7 KiB
Python
Raw Normal View History

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")
2018-04-26 06:20:33 +00:00
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='')
2018-04-23 13:07:58 +00:00
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
2018-05-16 03:09:59 +00:00
class Channel(models.Model):
2018-04-25 23:35:44 +00:00
name = models.CharField(max_length=255, default='')
description = models.CharField(max_length=255, default='')
members = models.ManyToManyField("Member")
2018-04-26 06:20:33 +00:00
owner = models.ForeignKey("Member", related_name="owned_chatrooms")
2018-04-25 23:35:44 +00:00
def __str__(self):
return self.name