kpsul/events/models.py
Martin Pépin 34e552f760
New 'events' app, first model
The objective is to move (at some point) all the management logic in
this app. Before that time: as long as the events app does not have all
the features necessary to be used in production it is only available in
dev mode and coexists with the old event system. When it's ready we'll
move the old events in the new app (data migration) and remove the old
system.
2019-10-06 19:24:32 +02:00

32 lines
1.2 KiB
Python

from django.db import models
from django.utils.translation import gettext_lazy as _
class Event(models.Model):
title = models.CharField(_("titre"), max_length=200)
location = models.CharField(_("lieu"), max_length=200)
start_date = models.DateTimeField(_("date de début"), blank=True, null=True)
end_date = models.DateTimeField(_("date de fin"), blank=True, null=True)
description = models.TextField(_("description"), blank=True)
image = models.ImageField(
_("image"), blank=True, null=True, upload_to="imgs/events/"
)
registration_open = models.BooleanField(_("inscriptions ouvertes"), default=True)
old = models.BooleanField(_("archiver (événement fini)"), default=False)
class Meta:
verbose_name = _("événement")
verbose_name_plural = _("événements")
def __str__(self):
return self.title
# TODO: gérer les inscriptions
# TODO: gérer les options (EventOption & EventOptionChoice de gestioncof)
# par exemple: "option végé au Mega (oui / non)"
# TODO: gérer les champs commentaires (EventCommentField & EventCommentChoice)
# par exemple: "champ "allergies / régime particulier" au Mega