diff --git a/events/migrations/0004_event_responsible_person.py b/events/migrations/0004_event_responsible_person.py new file mode 100644 index 0000000..97a007c --- /dev/null +++ b/events/migrations/0004_event_responsible_person.py @@ -0,0 +1,21 @@ +# Generated by Django 3.0.8 on 2020-07-25 00:43 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('events', '0003_event_note'), + ] + + operations = [ + migrations.AddField( + model_name='event', + name='responsible_person', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/events/models.py b/events/models.py index c5b1e0d..89cdec7 100644 --- a/events/models.py +++ b/events/models.py @@ -14,6 +14,7 @@ class Event(models.Model): time = models.IntegerField(choices=TIME_SLOTS.items(), default=MORNING) capacity = models.IntegerField(default=6) note = models.TextField(max_length=1024, default="") + responsible_person = models.ForeignKey(CustomUser, null=True, on_delete=models.SET_NULL) def __str__(self): return f"{self.date} {self.TIME_SLOTS[self.time]}" diff --git a/events/templates/events/registrations.html b/events/templates/events/registrations.html index 9fce07f..f9719f1 100644 --- a/events/templates/events/registrations.html +++ b/events/templates/events/registrations.html @@ -1,5 +1,7 @@