Add model
This commit is contained in:
parent
a866e43007
commit
a7a50dcada
|
@ -31,6 +31,7 @@ ALLOWED_HOSTS = []
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
|
'schedule.apps.ScheduleConfig',
|
||||||
'django.contrib.admin',
|
'django.contrib.admin',
|
||||||
'django.contrib.auth',
|
'django.contrib.auth',
|
||||||
'django.contrib.contenttypes',
|
'django.contrib.contenttypes',
|
||||||
|
|
|
@ -1,3 +1,23 @@
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
# Create your models here.
|
# 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)
|
||||||
|
|
Loading…
Reference in a new issue