From 43dbfd07836767bdaa3e07095bad66f6fcb6489e Mon Sep 17 00:00:00 2001 From: Ambulance Clerc Date: Mon, 2 May 2022 07:24:00 +0200 Subject: [PATCH] =?UTF-8?q?D=C3=A9bug=20calcule=20total=20par=20moi=20qui?= =?UTF-8?q?=20se=20bas=C3=A9=20sur=20la=20date=20de=20cr=C3=A9ation=20et?= =?UTF-8?q?=20non=20dtDate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- collabs/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/collabs/models.py b/collabs/models.py index 6d8685f..3b45fda 100644 --- a/collabs/models.py +++ b/collabs/models.py @@ -49,9 +49,9 @@ class Collabs_hour(models.Model): @admin.display( description='Total du mois') def get_total_hour_by_user(self): #objs = Collabs_hour.objects.filter(user_id=self.user_id,dtCreated__year=self.dtCreated.year, dtCreated__month=self.dtCreated.month) - objs = Collabs_hour.objects.filter(user_id=self.user_id, dtCreated__year=self.dtCreated.year , dtCreated__month=self.dtCreated.month) - print(f"user {self.user} dtCreated__year {self.dtCreated.year} dtCreated__month {self.dtCreated.month}") - print( Collabs_hour.objects.all()) + objs = Collabs_hour.objects.filter(user_id=self.user_id, dtDate__year=self.dtDate.year , dtDate__month=self.dtDate.month) + print(f"user {self.user} dtCreated__year {self.dtDate.year} dtCreated__month {self.dtDate.month}") + #print( Collabs_hour.objects.all()) total = 0.0