diff --git a/src/stats/migrations/0003_auto_20190122_1449.py b/src/stats/migrations/0003_auto_20190122_1449.py new file mode 100644 index 0000000000000000000000000000000000000000..a3689e8ee847704324f3821df0508d6b89ffbb0d --- /dev/null +++ b/src/stats/migrations/0003_auto_20190122_1449.py @@ -0,0 +1,24 @@ +# Generated by Django 2.0.1 on 2019-01-22 13:49 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('account', '0002_auto_20190122_1341'), + ('stats', '0002_event_description'), + ] + + operations = [ + migrations.AddField( + model_name='event', + name='absent', + field=models.ManyToManyField(blank=True, related_name='events_absent', to='account.Profile'), + ), + migrations.AlterField( + model_name='event', + name='visitors', + field=models.ManyToManyField(blank=True, related_name='events_visitor', to='account.Profile'), + ), + ] diff --git a/src/stats/models.py b/src/stats/models.py index c4fcbecaa8cbf102f1766c95d1c0bb1e8c735cc1..be958204fba61174220ddc988100c21405f44241 100644 --- a/src/stats/models.py +++ b/src/stats/models.py @@ -1,8 +1,6 @@ from django.db import models from account.models import Profile from common.middleware import CurrentUserMiddleware -from django.utils import timezone -from django.core.exceptions import ValidationError class Event(models.Model): @@ -11,7 +9,12 @@ class Event(models.Model): description = models.TextField(blank=True, default='') visitors = models.ManyToManyField( Profile, - related_name='events', + related_name='events_visitor', + blank=True + ) + absent = models.ManyToManyField( + Profile, + related_name='events_absent', blank=True ) created_by = models.ForeignKey(