From 4a315b81633e593c465b501cd21c894420ed2e90 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Mon, 26 Oct 2020 11:00:12 +0100 Subject: [PATCH] reorganisation of abstract model classes, minor change in /intern form --- input/forms.py | 3 +-- input/models.py | 13 +++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/input/forms.py b/input/forms.py index b204594..95a6fbc 100644 --- a/input/forms.py +++ b/input/forms.py @@ -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): diff --git a/input/models.py b/input/models.py index 3c3619a..1a4da2c 100644 --- a/input/models.py +++ b/input/models.py @@ -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)