reorganisation of abstract model classes, minor change in /intern form

This commit is contained in:
Benni Baermann 2020-10-26 11:00:12 +01:00
parent 0ce0151b16
commit 4a315b8163
2 changed files with 12 additions and 4 deletions

View file

@ -31,8 +31,7 @@ class VolunteerForm(ModelForm):
exclude = ('granted', 'granted_date', 'survey_mail_send')
INTERN_CHOICES = [('PRO', 'Projektsteckbrief'),
('HON', 'Ehrenamtsbescheinigung'),
('AKK', 'Akkreditierung oder Redaktionsbestätigung'),
('HON', 'Ehrenamtsbescheinigung, Akkreditierung oder Redaktionsbestätigung'),
('TRAV', 'Reisekostenerstattung')]
class InternForm(ModelForm):

View file

@ -26,6 +26,13 @@ class Volunteer(models.Model):
abstract = True
class Extern(Volunteer):
''' abstract basis class for all data entered by extern volunteers '''
username = models.CharField(max_length=200, null=True)
class Meta:
abstract = True
class Project(Volunteer):
name = models.CharField(max_length=200)
start = models.DateField('Startdatum', null=True)
@ -48,6 +55,8 @@ class Project(Volunteer):
class HonoraryCertificate(Volunteer):
''' this class is also used for accreditations '''
request_url = models.CharField(max_length=2000)
project = models.ForeignKey(Project, null = True, on_delete = models.SET_NULL)
@ -55,8 +64,8 @@ class HonoraryCertificate(Volunteer):
return "Certificate for " + self.realname
#abstract base class for Library, IFG, ...
class Grant(Volunteer):
#abstract base class for Library and IFG
class Grant(Extern):
cost = models.CharField(max_length=10)
notes = models.CharField(max_length=500)