Last active
February 18, 2019 15:00
-
-
Save eeriksp/6988438c85c489f5fcb4d142f298d719 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Charity(models.Model): | |
name = models.CharField(max_length=50, unique=True) | |
webpage = models.URLField(unique=True) | |
def __str__(self): | |
return self.name | |
class Volunteer(models.Model): | |
charity = models.ForeignKey(Charity, on_delete=models.PROTECT) | |
name = models.CharField(max_length=50) | |
email = models.EmailField(unique=True) | |
def __str__(self): | |
return self.name | |
class Project(models.Model): | |
director = models.ForeignKey(Volunteer, on_delete=models.PROTECT) | |
name = models.CharField(max_length=50) | |
deadline = models.DateField() | |
def __str__(self): | |
return self.name | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment