From dd8d2cc4db2529af99419786841a79472ca16bb5 Mon Sep 17 00:00:00 2001 From: Celestino Rey Date: Fri, 6 Sep 2024 13:16:22 +0200 Subject: [PATCH] Agrupo la lista de cuentas por tipo Signed-off-by: Celestino Rey --- Finanzas/K8S/Makefile | 2 +- Finanzas/finanzas/apuntes/views.py | 5 +- .../templates/apuntes/lista_cuentas.html | 92 ++++++++++--------- 3 files changed, 53 insertions(+), 46 deletions(-) diff --git a/Finanzas/K8S/Makefile b/Finanzas/K8S/Makefile index 14cdae3..eb4157b 100644 --- a/Finanzas/K8S/Makefile +++ b/Finanzas/K8S/Makefile @@ -1,7 +1,7 @@ export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':') #export REGISTRY=registry.cube.local export REGISTRY=registry.reymota.es -export IMG_VERSION = 0.6 +export IMG_VERSION = 0.7 export IMG_NGINX_VERSION = 1.0 # limpia todo diff --git a/Finanzas/finanzas/apuntes/views.py b/Finanzas/finanzas/apuntes/views.py index 2950cd3..55f25fb 100644 --- a/Finanzas/finanzas/apuntes/views.py +++ b/Finanzas/finanzas/apuntes/views.py @@ -22,7 +22,10 @@ def principal(request): @login_required def lista_cuentas(request): cuentas = Cuenta.objects.all() - return render(request, 'apuntes/lista_cuentas.html', {'cuentas': cuentas}) + + tipos = Tipo.objects.prefetch_related('cuenta_set').all() + + return render(request, 'apuntes/lista_cuentas.html', {'tipos': tipos, 'cuentas': cuentas}) @login_required diff --git a/Finanzas/finanzas/templates/apuntes/lista_cuentas.html b/Finanzas/finanzas/templates/apuntes/lista_cuentas.html index d96508f..aa8fdcd 100644 --- a/Finanzas/finanzas/templates/apuntes/lista_cuentas.html +++ b/Finanzas/finanzas/templates/apuntes/lista_cuentas.html @@ -8,6 +8,7 @@

Cuentas

+
@@ -19,54 +20,57 @@
- {% for cuenta in cuentas %} -
-
-
-

{{ cuenta.nombre}}

-
- -
- - -
- + {% endfor %} + {% endfor %}
- {% endfor %}
{% endblock %}