# Copyright (C) 2020 by BDE ENS Paris-Saclay from django.db import models from django.utils.translation import gettext_lazy as _ class Ticket(models.Model): number = models.PositiveIntegerField( verbose_name=_("number") ) note = models.CharField( max_length=255, blank=True, null=True, verbose_name=_("note") ) def __str__(self): return "n°" + str(self.number) + " : " + str(self.note) class Reward(models.Model): order = models.PositiveIntegerField( verbose_name=_("order"), ) name = models.CharField( max_length=255, verbose_name=_("name"), ) image = models.ImageField( verbose_name=_("image"), ) rewarded_by = models.ForeignKey( Ticket, on_delete=models.PROTECT, null=True, blank=True, verbose_name=_("rewarded by"), ) def __str__(self): return str(self.order) + " - " + str(self.name)