Files
kakebo/app/expenses/admin.py
Andros Fenollosa 19f4e84a30 Remove user FK from all models, add goals and promises
- Remove user ForeignKey from all 7 models (single-user app)
- Update all views, handlers, forms, admin, API, seed, and tests
- Add MonthlyGoal model with goals and promises sections
- Goals/promises: add, toggle (strikethrough), delete via LiveView
2026-03-18 15:18:50 +01:00

28 lines
659 B
Python

from django.contrib import admin
from .models import Category, Expense, Subcategory
class SubcategoryInline(admin.TabularInline):
model = Subcategory
extra = 1
@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
list_display = ["name", "order"]
inlines = [SubcategoryInline]
@admin.register(Subcategory)
class SubcategoryAdmin(admin.ModelAdmin):
list_display = ["name", "category", "order"]
list_filter = ["category"]
@admin.register(Expense)
class ExpenseAdmin(admin.ModelAdmin):
list_display = ["concept", "amount", "category", "subcategory", "created_at"]
list_filter = ["category", "created_at"]
search_fields = ["concept"]