Add snapshot list

This commit is contained in:
Edgar P. Burkhart 2022-05-22 08:37:52 +02:00
parent 29484e3c02
commit a3797bb7fb
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
3 changed files with 42 additions and 15 deletions

View file

@ -10,17 +10,20 @@ from .models import (
InvoiceForm,
Category,
CategoryForm,
Snapshot,
)
@login_required
def index(request):
_transactions = Transaction.objects.order_by("-date")[:5]
_transactions = Transaction.objects.all()[:5]
_categories = Category.objects.all()
_snapshots = Snapshot.objects.all()[:5]
context = {
"transactions": _transactions,
"categories": _categories,
"snapshots": _snapshots,
}
return render(request, "main/index.html", context)