38 lines
738 B
Python
38 lines
738 B
Python
# 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")
|
|
)
|