add event subscriptions (models only)
This commit is contained in:
parent
730611039b
commit
41a3c4c161
2 changed files with 26 additions and 2 deletions
22
events/migrations/0002_event_subscribers.py
Normal file
22
events/migrations/0002_event_subscribers.py
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
# Generated by Django 2.2.6 on 2019-10-05 13:03
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
|
("events", "0001_event"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name="event",
|
||||||
|
name="subscribers",
|
||||||
|
field=models.ManyToManyField(
|
||||||
|
to=settings.AUTH_USER_MODEL, verbose_name="inscrit⋅e⋅s"
|
||||||
|
),
|
||||||
|
)
|
||||||
|
]
|
|
@ -1,6 +1,9 @@
|
||||||
|
from django.contrib.auth import get_user_model
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
User = get_user_model()
|
||||||
|
|
||||||
|
|
||||||
class Event(models.Model):
|
class Event(models.Model):
|
||||||
title = models.CharField(_("titre"), max_length=200)
|
title = models.CharField(_("titre"), max_length=200)
|
||||||
|
@ -13,6 +16,7 @@ class Event(models.Model):
|
||||||
)
|
)
|
||||||
registration_open = models.BooleanField(_("inscriptions ouvertes"), default=True)
|
registration_open = models.BooleanField(_("inscriptions ouvertes"), default=True)
|
||||||
old = models.BooleanField(_("archiver (événement fini)"), default=False)
|
old = models.BooleanField(_("archiver (événement fini)"), default=False)
|
||||||
|
subscribers = models.ManyToManyField(User, verbose_name=_("inscrit⋅e⋅s"))
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _("événement")
|
verbose_name = _("événement")
|
||||||
|
@ -22,8 +26,6 @@ class Event(models.Model):
|
||||||
return self.title
|
return self.title
|
||||||
|
|
||||||
|
|
||||||
# TODO: gérer les inscriptions
|
|
||||||
|
|
||||||
# TODO: gérer les options (EventOption & EventOptionChoice de gestioncof)
|
# TODO: gérer les options (EventOption & EventOptionChoice de gestioncof)
|
||||||
# par exemple: "option végé au Mega (oui / non)"
|
# par exemple: "option végé au Mega (oui / non)"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue