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.

34 lines
1.0 KiB

4 years ago
4 years ago
  1. from django.db import models
  2. class Volonteer(models.Model):
  3. realname = models.CharField(max_length=200, null=True)
  4. email = models.CharField(max_length=200, null=True)
  5. username = models.CharField(max_length=200, null=True)
  6. class Meta:
  7. abstract = True
  8. class Project(Volonteer):
  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
  14. class HonoraryCertificate(Volonteer):
  15. request_url = models.CharField(max_length=400) #can urls be longer in theory?
  16. number = models.IntegerField(null = True)
  17. def __str__(self):
  18. return "Certificate for " + self.realname
  19. class Library(Volonteer):
  20. library = models.CharField(max_length=200)
  21. cost = models.CharField(max_length=10)
  22. duration = models.CharField(max_length=100)
  23. notes = models.CharField(max_length=500)
  24. def __str__(self):
  25. return self.library