foerderbarometer/input/models.py

48 lines
1.3 KiB
Python
Raw Normal View History

2020-09-21 12:27:16 +00:00
from django.db import models
2020-09-22 10:21:05 +00:00
2020-09-30 12:17:38 +00:00
class Volunteer(models.Model):
2020-09-30 10:15:58 +00:00
realname = models.CharField(max_length=200, null=True)
email = models.CharField(max_length=200, null=True)
username = models.CharField(max_length=200, null=True)
2020-09-22 10:21:05 +00:00
2020-09-30 10:15:58 +00:00
class Meta:
abstract = True
2020-09-30 09:04:47 +00:00
2020-09-30 12:17:38 +00:00
class Project(Volunteer):
2020-09-30 09:04:47 +00:00
name = models.CharField(max_length=200)
2020-09-30 09:52:33 +00:00
start = models.DateTimeField('start date')
2020-09-30 10:15:58 +00:00
# contact = models.ForeignKey(Volonteer, on_delete = models.CASCADE, null = True)
2020-09-30 09:04:47 +00:00
def __str__(self):
return self.name
2020-09-30 12:17:38 +00:00
class HonoraryCertificate(Volunteer):
request_url = models.CharField(max_length=400) #can urls be longer in theory?
number = models.IntegerField(null = True)
def __str__(self):
return "Certificate for " + self.realname
2020-09-30 11:46:06 +00:00
2020-09-30 12:17:38 +00:00
#abstract class for Library, IFG, ...
class Grant(Volunteer):
2020-09-30 11:46:06 +00:00
cost = models.CharField(max_length=10)
notes = models.CharField(max_length=500)
2020-09-30 12:17:38 +00:00
class Meta:
abstract = True
# should be identical for ELitStip and Software?
class Library(Grant):
library = models.CharField(max_length=200)
duration = models.CharField(max_length=100)
2020-09-30 11:46:06 +00:00
def __str__(self):
return self.library
2020-09-30 12:17:38 +00:00
class IFG(Grant):
url = models.CharField(max_length=400) #can urls be longer in theory?
def __str__(self):
return "IFG-Anfrage von " + self.realname