Browse Source

Foreignkey(Volonteer) added

master
Benni Baermann 4 years ago
parent
commit
45a92dfc9c
1 changed files with 6 additions and 5 deletions
  1. +6
    -5
      input/models.py

+ 6
- 5
input/models.py View File

@ -1,17 +1,18 @@
from django.db import models from django.db import models
class Project(models.Model):
class Volonteer(models.Model):
name = models.CharField(max_length=200) 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): def __str__(self):
return self.name return self.name
class Volonteer(models.Model):
class Project(models.Model):
name = models.CharField(max_length=200) 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): def __str__(self):
return self.name return self.name

Loading…
Cancel
Save