summaryrefslogtreecommitdiff
path: root/app/budget/admin.py
blob: 0f578fbc737b4a8b15d4a09275db110c4f4c3c2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from django.contrib import admin
from .models import LuxSource, LuxPurchase, LuxSpendingCategory, LuxFixedMonthly, LuxPaymentMethod


@admin.register(LuxSpendingCategory)
class SourceAdmin(admin.ModelAdmin):
    list_display = ('name',)


@admin.register(LuxSource)
class SourceAdmin(admin.ModelAdmin):
    list_display = ('name',)


@admin.register(LuxPurchase)
class PurchaseAdmin(admin.ModelAdmin):
    list_display = ('source', 'amount', 'category' )
    search_fields = ['source', 'amount']
    list_filter = ('category',)

    class Media:
        js = ('next-prev-links.js',)


@admin.register(LuxFixedMonthly)
class LuxFixedMonthlyAdmin(admin.ModelAdmin):
    list_display = ('name', 'amount', 'category', 'payment_method')


@admin.register(LuxPaymentMethod)
class LuxPaymentMethodAdmin(admin.ModelAdmin):
    list_display = ('name',)