From 45a92dfc9c080b9a86ab83824a23ac5d3988c37e Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Wed, 30 Sep 2020 11:52:33 +0200 Subject: [PATCH] Foreignkey(Volonteer) added --- input/models.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/input/models.py b/input/models.py index 4242e63..b1739ff 100644 --- a/input/models.py +++ b/input/models.py @@ -1,17 +1,18 @@ from django.db import models -class Project(models.Model): +class Volonteer(models.Model): name = models.CharField(max_length=200) - start = models.DateTimeField('start date') + email = models.CharField(max_length=200) + username = models.CharField(max_length=200) def __str__(self): return self.name -class Volonteer(models.Model): +class Project(models.Model): name = models.CharField(max_length=200) - email = models.CharField(max_length=200) - username = models.CharField(max_length=200) + start = models.DateTimeField('start date') + contact = models.ForeignKey(Volonteer, on_delete = models.CASCADE, null = True) def __str__(self): return self.name