Browse Source

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

master
Benni Baermann 4 years ago
parent
commit
4a315b8163
2 changed files with 12 additions and 4 deletions
  1. +1
    -2
      input/forms.py
  2. +11
    -2
      input/models.py

+ 1
- 2
input/forms.py 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):

+ 11
- 2
input/models.py 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)

Loading…
Cancel
Save