Débug calcule total par moi qui se basé sur la date de création et non dtDate

This commit is contained in:
Ambulance Clerc
2022-05-02 07:24:00 +02:00
parent 688d526d96
commit 43dbfd0783

View File

@@ -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