Re: Get last instance object per each month and sum per month in Django

2020-02-26 Thread Mario Bisiani
ach-relation> >> : >> >> @classmethod >> def get_latest_by_activity_ids(cls, activity_id): >> found = [] >> for aid in Activity.objects.all(): >> >> found.append(cls.objects.filter(activity_id=aid).lates

Re: Get last instance object per each month and sum per month in Django

2020-02-26 Thread Mario Bisiani
on> >>> : >>> >>> @classmethod >>> def get_latest_by_activity_ids(cls, activity_id): >>> found = [] >>> for aid in Activity.objects.all(): >>> >>> found.append(cls.objects.filter(activity_id=aid).lat

Re: Get last instance object per each month and sum per month in Django

2020-02-25 Thread Simon Charette
t; : >> >> @classmethod >> def get_latest_by_activity_ids(cls, activity_id): >> found = [] >> for aid in Activity.objects.all(): >> >> found.append(cls.objects.filter(activity_id=aid).latest("status_date")) >>

Re: Get last instance object per each month and sum per month in Django

2020-02-25 Thread Agnese Camellini
return found > > This gave me a list of dates. Now I'm blocked to sum them up per month. > > > > https://stackoverflow.com/questions/60366457/get-last-instance-object-per-each-month-and-sum-per-month-in-django > > > -- > You received this message because

Get last instance object per each month and sum per month in Django

2020-02-25 Thread Mario Bisiani
.objects.filter(activity_id=aid).latest("status_date")) return found This gave me a list of dates. Now I'm blocked to sum them up per month. https://stackoverflow.com/questions/60366457/get-last-instance-object-per-each-month-and-sum-per-month-in-django -- You received