From a7a50dcadae85897161f038498eb2a749b1b5832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Thu, 9 Apr 2020 14:56:28 +0200 Subject: [PATCH] Add model --- config/settings.py | 1 + schedule/models.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/config/settings.py b/config/settings.py index cc617e0..bf42b85 100644 --- a/config/settings.py +++ b/config/settings.py @@ -31,6 +31,7 @@ ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ + 'schedule.apps.ScheduleConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', diff --git a/schedule/models.py b/schedule/models.py index 71a8362..fe7bcac 100644 --- a/schedule/models.py +++ b/schedule/models.py @@ -1,3 +1,23 @@ from django.db import models # Create your models here. + +class PickupDate(models.Model): + date = models.DateField('date of pickup') + +class Timeslot(models.Model): + start = models.TimeField('start of timeslot') + # open-ended for now + +class Member(models.Model): + member_number = models.PositiveIntegerField( + verbose_name='aoff member number', + unique=True, + blank=True, + null=True, + ) + +class Pickup(models.Model): + date = models.ForeignKey(PickupDate, on_delete=models.CASCADE) + time = models.ForeignKey(Timeslot, on_delete=models.CASCADE) + member = models.ForeignKey(Member, on_delete=models.CASCADE)