You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
502 B

4 years ago
4 years ago
  1. from django.db import models
  2. class Volonteer(models.Model):
  3. name = models.CharField(max_length=200)
  4. email = models.CharField(max_length=200)
  5. username = models.CharField(max_length=200)
  6. def __str__(self):
  7. return self.name
  8. class Project(models.Model):
  9. name = models.CharField(max_length=200)
  10. start = models.DateTimeField('start date')
  11. contact = models.ForeignKey(Volonteer, on_delete = models.CASCADE, null = True)
  12. def __str__(self):
  13. return self.name