accounts now user editable in own table
This commit is contained in:
parent
cdb27e6b89
commit
6a2dc6f1c9
5 changed files with 66 additions and 7 deletions
|
@ -3,7 +3,7 @@ import csv
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
|
|
||||||
from .models import Accounts, Project, HonoraryCertificate, Library, IFG, Travel,\
|
from .models import Account, Project, HonoraryCertificate, Library, IFG, Travel,\
|
||||||
Email, BusinessCard, List, Literature
|
Email, BusinessCard, List, Literature
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ class ProjectAdmin(admin.ModelAdmin):
|
||||||
|
|
||||||
|
|
||||||
admin.site.register([
|
admin.site.register([
|
||||||
Accounts,
|
Account,
|
||||||
HonoraryCertificate,
|
HonoraryCertificate,
|
||||||
Library,
|
Library,
|
||||||
IFG,
|
IFG,
|
||||||
|
|
23
input/migrations/0063_auto_20210708_0553.py
Normal file
23
input/migrations/0063_auto_20210708_0553.py
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# Generated by Django 3.2.5 on 2021-07-08 05:53
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('input', '0062_auto_20210707_1314'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='accounts',
|
||||||
|
old_name='acc',
|
||||||
|
new_name='code',
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='accounts',
|
||||||
|
name='description',
|
||||||
|
field=models.CharField(default='NO DESCRIPTION', max_length=30, verbose_name='Beschreibung'),
|
||||||
|
),
|
||||||
|
]
|
18
input/migrations/0064_alter_accounts_code.py
Normal file
18
input/migrations/0064_alter_accounts_code.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# Generated by Django 3.2.5 on 2021-07-08 05:55
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('input', '0063_auto_20210708_0553'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='accounts',
|
||||||
|
name='code',
|
||||||
|
field=models.CharField(default='DEF', max_length=5, primary_key=True, serialize=False, verbose_name='Kostenstelle'),
|
||||||
|
),
|
||||||
|
]
|
17
input/migrations/0065_rename_accounts_account.py
Normal file
17
input/migrations/0065_rename_accounts_account.py
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# Generated by Django 3.2.5 on 2021-07-08 05:58
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('input', '0064_alter_accounts_code'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RenameModel(
|
||||||
|
old_name='Accounts',
|
||||||
|
new_name='Account',
|
||||||
|
),
|
||||||
|
]
|
|
@ -50,12 +50,13 @@ class ConcreteExtern(Extern):
|
||||||
''' needed because we can't initiate abstract base classes in the view'''
|
''' needed because we can't initiate abstract base classes in the view'''
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class Accounts(models.Model):
|
class Account(models.Model):
|
||||||
acc = models.CharField('Kostenstelle', max_length=5, default="DEF",
|
code = models.CharField('Kostenstelle', max_length=5, default="DEF",
|
||||||
choices=ACCOUNTS.items(), null=False, primary_key = True)
|
null=False, primary_key = True)
|
||||||
|
description = models.CharField('Beschreibung', max_length=30, default='NO DESCRIPTION')
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{ACCOUNTS[self.acc]}"
|
return f"{self.code} {self.description}"
|
||||||
|
|
||||||
class Project(Volunteer):
|
class Project(Volunteer):
|
||||||
name = models.CharField(max_length=200, verbose_name='Name des Projekts')
|
name = models.CharField(max_length=200, verbose_name='Name des Projekts')
|
||||||
|
@ -74,7 +75,7 @@ class Project(Volunteer):
|
||||||
insurance_technic = models.BooleanField(default=False, verbose_name='Technikversicherung Ausland')
|
insurance_technic = models.BooleanField(default=False, verbose_name='Technikversicherung Ausland')
|
||||||
support = models.CharField(max_length=300, blank=True, null=True, verbose_name='Betreuungsperson und Vertretung')
|
support = models.CharField(max_length=300, blank=True, null=True, verbose_name='Betreuungsperson und Vertretung')
|
||||||
cost = models.IntegerField(blank=True, null=True)
|
cost = models.IntegerField(blank=True, null=True)
|
||||||
account = models.ForeignKey('Accounts', on_delete=models.CASCADE, null=True, to_field='acc')
|
account = models.ForeignKey('Account', on_delete=models.CASCADE, null=True, to_field='code')
|
||||||
granted_from = models.CharField(max_length=100,null=True,verbose_name='Bewilligt von')
|
granted_from = models.CharField(max_length=100,null=True,verbose_name='Bewilligt von')
|
||||||
notes = models.CharField(max_length=1000,null=True,blank=True,verbose_name='Anmerkungen')
|
notes = models.CharField(max_length=1000,null=True,blank=True,verbose_name='Anmerkungen')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue