|
|
@@ -20,7 +20,6 @@ import tempfile
|
|
|
from django.utils.dateparse import parse_date
|
|
|
from django.db.models import Sum
|
|
|
|
|
|
-import logging
|
|
|
import re
|
|
|
|
|
|
from accounts import models
|
|
|
@@ -28,9 +27,10 @@ from .models import Movimiento, Cuenta, MovimientoFrecuente, Categoria, Transacc
|
|
|
from .forms import MovimientoForm, FiltroForm, FiltroMesAnioForm, FiltroCuentaForm, InformeCuentaForm, FiltroInformeCuentaForm
|
|
|
from .recurrentes import procesar_transacciones_recurrentes
|
|
|
|
|
|
+import logging
|
|
|
|
|
|
-logger = logging.getLogger(__name__)
|
|
|
-
|
|
|
+logger_info = logging.getLogger('finanzas')
|
|
|
+logger_debug = logging.getLogger('django')
|
|
|
|
|
|
@login_required
|
|
|
def dashboard(request):
|
|
|
@@ -54,11 +54,13 @@ def dashboard(request):
|
|
|
fin_mes = timezone.make_aware(datetime(anio, mes, ultimo_dia, 23, 59, 59))
|
|
|
|
|
|
movimientos = Movimiento.objects.filter(usuario=request.user, fecha__range=(inicio_mes, fin_mes)).order_by('-fecha')
|
|
|
- # logger.warning(f"dashboard: movimientos: {movimientos}")
|
|
|
|
|
|
favoritas = Cuenta.objects.filter(favorita='True').order_by('nombre')
|
|
|
|
|
|
frecuentes = MovimientoFrecuente.objects.filter(usuario=request.user).order_by('cuenta_destino')
|
|
|
+
|
|
|
+ logger_debug.debug("Rendering dashboard view with %d movimientos and %d favoritas", movimientos.count(), favoritas.count())
|
|
|
+ logger_info.info("User %s accessed principal view", request.user.username if request.user.is_authenticated else "Anonymous")
|
|
|
|
|
|
form_filtro = FiltroForm(request.GET or None)
|
|
|
|