new field finance_id

This commit is contained in:
Benni Bärmann 2021-10-04 10:43:50 +02:00
parent e4c8967a07
commit 6fdd04306f
3 changed files with 23 additions and 5 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 3.2.5 on 2021-10-04 08:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('input', '0065_rename_accounts_account'),
]
operations = [
migrations.AddField(
model_name='project',
name='finance_id',
field=models.CharField(blank=True, max_length=15, null=True),
),
]

View File

@ -39,9 +39,9 @@ class Extern(Volunteer):
def save(self,*args,**kwargs):
# is there a way to call super().save() only once?
super().save(*args,*kwargs)
super().save(*args,**kwargs)
self.service_id = type(self).__name__ + str(self.pk)
super().save(*args,*kwargs)
super().save(*args,**kwargs)
class Meta:
abstract = True
@ -84,7 +84,7 @@ class Project(Volunteer):
end_mail_send = models.BooleanField(null=True)
status = models.CharField(max_length=3,choices=(('RUN', 'läuft'),('END','beendet')),default='RUN')
persons = models.IntegerField(default=1)
finance_id = models.CharField(max_length=15, null= True, blank=True)
def save(self,*args,**kwargs):
# is there a way to call super().save() only once?

View File

@ -50,5 +50,5 @@ class TestWithLogin(TestCase):
#acc.save()
obj = Project.objects.create(account= acc, name='testproject', start='2022-01-01')
#obj.save()
print(f'pid: {obj.pid}')
self.assertEqual(obj.pid,'1234000')
print(f'pid: {obj.finance_id}')
self.assertEqual(obj.finance_id,'1234000')