From 34f70d98471bfc9aeeee849166d6db0f7e19be14 Mon Sep 17 00:00:00 2001 From: Camilo Serrano Date: Mon, 27 Jul 2020 23:49:19 -0500 Subject: [PATCH 1/2] created Attendee and ActivityAttendee clasees --- acm_web_site/apps/business/activities/models.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/acm_web_site/apps/business/activities/models.py b/acm_web_site/apps/business/activities/models.py index f75a830..ad8cb61 100644 --- a/acm_web_site/apps/business/activities/models.py +++ b/acm_web_site/apps/business/activities/models.py @@ -95,3 +95,16 @@ class Tutorial(models.Model): def __str__(self): return '%s' % self.name + + +class Attendee(models.Model): + name = models.CharField(max_length=100) + email = models.EmailField(unique=True) + + def __str__(self): + return '%s - %s' % (self.name, self.email) + + +class ActivityAttendee(models.Model): + activity = models.ForeignKey(Activity, on_delete=models.CASCADE) + member = models.ForeignKey(Member, on_delete=models.CASCADE) From 6b53ab25a7693620c3a24ecdf9db62db88eee3f4 Mon Sep 17 00:00:00 2001 From: Camilo Serrano Date: Tue, 28 Jul 2020 13:31:33 -0500 Subject: [PATCH 2/2] fixed typo en ActivityAttendee foreign key --- acm_web_site/apps/business/activities/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acm_web_site/apps/business/activities/models.py b/acm_web_site/apps/business/activities/models.py index ad8cb61..8251daf 100644 --- a/acm_web_site/apps/business/activities/models.py +++ b/acm_web_site/apps/business/activities/models.py @@ -107,4 +107,4 @@ def __str__(self): class ActivityAttendee(models.Model): activity = models.ForeignKey(Activity, on_delete=models.CASCADE) - member = models.ForeignKey(Member, on_delete=models.CASCADE) + attendee = models.ForeignKey(Attendee, on_delete=models.CASCADE)