tombola-bde-2020/apps/tbde/models.py

38 lines
738 B
Python
Raw Normal View History

2020-02-29 06:20:47 +00:00
# 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,
verbose_name=_("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,
verbose_name=_("rewarded by")
)