You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
4.7 KiB

from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class place(models.Model):
name = models.CharField(max_length=50)
def __str__(self):
return str(self.id) + " - " + str(self.name)
class contributors(models.Model):
first_name = models.CharField(max_length=50)
name = models.CharField(max_length=50)
ordner = models.BooleanField(default=False)
saalordner = models.BooleanField(default=False)
anlage = models.BooleanField(default=False)
buehne = models.BooleanField(default=False)
zoom = models.BooleanField(default=False)
treffpunkt = models.BooleanField(default=False)
def __str__(self):
return self.first_name
class group(models.Model):
Name = models.CharField(max_length=10)
def __str__(self):
return str(self.Name)
class week(models.Model):
date_of_monday = models.CharField(max_length=50)
place = models.ForeignKey(place, on_delete=models.CASCADE,default=1)
info_field = models.CharField(max_length=100, null=True)
def __str__(self):
return self.date_of_monday
class service(models.Model):
TYPES = (
(1, 'Saal'),
(2, 'Zoom'),
(3, 'Gruppe'),
)
week = models.ForeignKey(week, on_delete=models.CASCADE)
date_1 = models.DateField(auto_now_add=False, null=True)
time_1 = models.TimeField(auto_now_add=False, null=True)
type_1 = models.IntegerField(auto_created=False, choices=TYPES, null=True)
speaker_1 = models.ForeignKey(contributors, on_delete=models.CASCADE, related_name="speaker_1", null=True)
date_2 = models.DateField(auto_now_add=False, null=True)
time_2 = models.TimeField(auto_now_add=False, null=True)
type_2 = models.IntegerField(auto_created=False, choices=TYPES, null=True)
speaker_2 = models.ForeignKey(contributors, on_delete=models.CASCADE, related_name="speaker_2", null=True)
date_3 = models.DateField(auto_now_add=False, null=True)
time_3 = models.TimeField(auto_now_add=False, null=True)
type_3 = models.IntegerField(auto_created=False, choices=TYPES, null=True)
speaker_3 = models.ForeignKey(contributors, on_delete=models.CASCADE, related_name="speaker_3", null=True)
date_4 = models.DateField(auto_now_add=False, null=True)
time_4 = models.TimeField(auto_now_add=False, null=True)
type_4 = models.IntegerField(auto_created=False, choices=TYPES, null=True)
speaker_4 = models.ForeignKey(contributors, on_delete=models.CASCADE, related_name="speaker_4", null=True)
date_5 = models.DateField(auto_now_add=False, null=True)
time_5 = models.TimeField(auto_now_add=False, null=True)
type_5 = models.IntegerField(auto_created=False, choices=TYPES, null=True)
speaker_5 = models.ForeignKey(contributors, on_delete=models.CASCADE, related_name="speaker_5", null=True)
date_6 = models.DateField(auto_now_add=False, null=True)
time_6 = models.TimeField(auto_now_add=False, null=True)
type_6 = models.IntegerField(auto_created=False, choices=TYPES, null=True)
speaker_6 = models.ForeignKey(contributors, on_delete=models.CASCADE, related_name="speaker_6", null=True)
def __str__(self):
return str(self.week)
class steward(models.Model):
week = models.ForeignKey(week, on_delete=models.CASCADE)
hall_1 = models.ForeignKey(contributors, on_delete=models.CASCADE, related_name="hall1", null=True)
hall_2 = models.ForeignKey(contributors, on_delete=models.CASCADE, related_name="hall2", null=True)
foyer_1 = models.ForeignKey(contributors, on_delete=models.CASCADE, related_name="foyer1", null=True)
foyer_2 = models.ForeignKey(contributors, on_delete=models.CASCADE, related_name="foyer2", null=True)
def __str__(self):
return str(self.week)
class regie(models.Model):
week = models.ForeignKey(week, on_delete=models.CASCADE)
regie_1 = models.ForeignKey(contributors, on_delete=models.CASCADE, related_name="regie1", null=True)
regie_2 = models.ForeignKey(contributors, on_delete=models.CASCADE, related_name="regie2", null=True)
zoom_1 = models.ForeignKey(contributors, on_delete=models.CASCADE, related_name="zoom1", null=True)
zoom_2 = models.ForeignKey(contributors, on_delete=models.CASCADE, related_name="zoom2", null=True)
stage = models.ForeignKey(contributors, on_delete=models.CASCADE, related_name="stage", null=True)
def __str__(self):
return str(self.week)
class info(models.Model):
week = models.ForeignKey(week, on_delete=models.CASCADE)
gast = models.ForeignKey(group, on_delete=models.CASCADE, related_name="gastPerson", null=True)
cleaning = models.ForeignKey(group, on_delete=models.CASCADE, related_name="CleanPerson", null=True)
def __str__(self):
return str(self.week)

Powered by TurnKey Linux.