from django.db import models class Mensa(models.Model): mensa_id = models.IntegerField() def __str__(self): return str(self.mensa_id) class DailyMenu(models.Model): date = models.DateField() mensa = models.ForeignKey(Mensa, on_delete=models.CASCADE, default=0) def __str__(self): return f"Mensa {self.mensa} - {self.date}" class Meal(models.Model): related_daily_menus = models.ManyToManyField(DailyMenu) name = models.CharField(max_length=100) art = models.CharField(max_length=100, default=None) price_student = models.FloatField(max_length=100) price_employee = models.FloatField(max_length=100) price_guest = models.FloatField(max_length=100) allergens = models.CharField(max_length=100) types = models.CharField(max_length=100) likes = models.IntegerField(default=0) dislikes = models.IntegerField(default=0) def __str__(self): return self.name class Comment(models.Model): meal = models.ForeignKey(Meal, on_delete=models.CASCADE, default=None) username = models.CharField(max_length=100, default='anon') comment = models.CharField(max_length=700)