summaryrefslogtreecommitdiff
path: root/postgresqleu/accounting/admin.py
diff options
context:
space:
mode:
authorMagnus Hagander2018-12-14 14:43:56 +0000
committerMagnus Hagander2018-12-14 15:31:28 +0000
commit7dea97f90b534f71cbec6d0e5dfbdf237403b1f1 (patch)
tree48c53ef74987f68c05f12fb1e97b02f25a13e45a /postgresqleu/accounting/admin.py
parente0bfd4f892e43db89bc996c1474f59c2dd6a8dc6 (diff)
Fix blankline related warnings
Diffstat (limited to 'postgresqleu/accounting/admin.py')
-rw-r--r--postgresqleu/accounting/admin.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/postgresqleu/accounting/admin.py b/postgresqleu/accounting/admin.py
index 0d65eeec..3e8bc6dd 100644
--- a/postgresqleu/accounting/admin.py
+++ b/postgresqleu/accounting/admin.py
@@ -5,12 +5,15 @@ from django.forms.models import BaseInlineFormSet
from models import AccountClass, AccountGroup, Account, IncomingBalance
from models import JournalEntry, JournalItem, JournalUrl, Object, Year
+
class AccountClassAdmin(admin.ModelAdmin):
list_display = ('name', 'inbalance', 'balancenegative')
+
class AccountAdmin(admin.ModelAdmin):
list_display = ('num', 'name')
+
class JournalItemFormset(BaseInlineFormSet):
def clean(self):
super(JournalItemFormset, self).clean()
@@ -20,26 +23,33 @@ class JournalItemFormset(BaseInlineFormSet):
if s != 0:
raise ValidationError("Journal entry does not balance!")
+
class JournalItemInline(admin.TabularInline):
model = JournalItem
formset = JournalItemFormset
+
class JournalUrlInline(admin.TabularInline):
model = JournalUrl
+
class JournalEntryAdmin(admin.ModelAdmin):
inlines = [JournalItemInline, JournalUrlInline]
list_display = ('__unicode__', 'year', 'seq', 'date', 'closed')
+
class IncomingBalanceAdmin(admin.ModelAdmin):
list_display = ('__unicode__', 'year', 'account', 'amount')
+
class ObjectAdmin(admin.ModelAdmin):
list_display = ('name', 'active')
+
class YearAdmin(admin.ModelAdmin):
readonly_fields = ('year',)
+
admin.site.register(AccountClass, AccountClassAdmin)
admin.site.register(AccountGroup)
admin.site.register(Account, AccountAdmin)