Compare commits
3 Commits
015b6db2f7
...
d211326c3f
Author | SHA1 | Date |
---|---|---|
Lukáš Kucharczyk | d211326c3f | |
Lukáš Kucharczyk | 270a291f05 | |
Lukáš Kucharczyk | 13b750ca92 |
|
@ -1,3 +1,8 @@
|
||||||
|
### Unreleased
|
||||||
|
|
||||||
|
## New
|
||||||
|
* Add stat for finished this year's games
|
||||||
|
|
||||||
## 1.4.0 / 2023-11-09 21:01+01:00
|
## 1.4.0 / 2023-11-09 21:01+01:00
|
||||||
|
|
||||||
### New
|
### New
|
||||||
|
|
|
@ -45,6 +45,10 @@
|
||||||
<td class="px-2 sm:px-4 md:px-6 md:py-2">Finished</td>
|
<td class="px-2 sm:px-4 md:px-6 md:py-2">Finished</td>
|
||||||
<td class="px-2 sm:px-4 md:px-6 md:py-2 font-mono">{{ all_finished_this_year.count }}</td>
|
<td class="px-2 sm:px-4 md:px-6 md:py-2 font-mono">{{ all_finished_this_year.count }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="px-2 sm:px-4 md:px-6 md:py-2">Finished ({{ year }})</td>
|
||||||
|
<td class="px-2 sm:px-4 md:px-6 md:py-2 font-mono">{{ this_year_finished_this_year.count }}</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -32,7 +32,12 @@ def model_counts(request):
|
||||||
|
|
||||||
|
|
||||||
def stats_dropdown_year_range(request):
|
def stats_dropdown_year_range(request):
|
||||||
return {"stats_dropdown_year_range": range(2018, 2024)}
|
result = {
|
||||||
|
"stats_dropdown_year_range": range(
|
||||||
|
datetime.now(ZoneInfo(settings.TIME_ZONE)).year, 1999, -1
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
def add_session(request, purchase_id=None):
|
def add_session(request, purchase_id=None):
|
||||||
|
@ -331,7 +336,7 @@ def stats(request, year: int = 0):
|
||||||
this_year_spendings = this_year_purchases_without_refunded.aggregate(
|
this_year_spendings = this_year_purchases_without_refunded.aggregate(
|
||||||
total_spent=Sum(F("price"))
|
total_spent=Sum(F("price"))
|
||||||
)
|
)
|
||||||
total_spent = this_year_spendings["total_spent"]
|
total_spent = this_year_spendings["total_spent"] or 0
|
||||||
|
|
||||||
games_with_playtime = (
|
games_with_playtime = (
|
||||||
Game.objects.filter(edition__purchase__session__in=this_year_sessions)
|
Game.objects.filter(edition__purchase__session__in=this_year_sessions)
|
||||||
|
|
Loading…
Reference in New Issue