From f579521a1a76eaa71f9c4b2c8152196a51de52b3 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Wed, 30 Sep 2020 12:15:58 +0200 Subject: [PATCH] moved Volonteer to abstract base class --- input/models.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/input/models.py b/input/models.py index b1739ff..722c7ab 100644 --- a/input/models.py +++ b/input/models.py @@ -2,17 +2,17 @@ from django.db import models class Volonteer(models.Model): - name = models.CharField(max_length=200) - email = models.CharField(max_length=200) - username = models.CharField(max_length=200) + realname = models.CharField(max_length=200, null=True) + email = models.CharField(max_length=200, null=True) + username = models.CharField(max_length=200, null=True) - def __str__(self): - return self.name + class Meta: + abstract = True -class Project(models.Model): +class Project(Volonteer): name = models.CharField(max_length=200) start = models.DateTimeField('start date') - contact = models.ForeignKey(Volonteer, on_delete = models.CASCADE, null = True) + # contact = models.ForeignKey(Volonteer, on_delete = models.CASCADE, null = True) def __str__(self): return self.name