8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 03:13:12 +00:00

Repare logs/stats

This commit is contained in:
chirac 2016-11-21 03:32:52 +01:00
parent f01d78019e
commit 8cf1de4b02
2 changed files with 3 additions and 8 deletions

View file

@ -1,8 +1,3 @@
<ul class="pagination nav navbar-nav">
<li><a href="?onglet=1">1 mois</a></li>
<li><a href="?onglet=2">2 mois</a></li>
</ul>
{% for key_dict, stats_dict in stats_list.items %}
{% for key, stats in stats_dict.items %}
<table class="table table-striped">

View file

@ -126,9 +126,9 @@ def stats_users(request):
start_date = timezone.now() + relativedelta(months=-search_field[1])
stats = {
'Utilisateur' : {
'Machines' : User.objects.filter(registered__gt=search_field[1]).annotate(num=Count('machine')).order_by('-num')[:10],
'Facture' : User.objects.filter(registered__gt=search_field[1]).annotate(num=Count('facture')).order_by('-num')[:10],
'Bannissement' : User.objects.filter(registered__gt=search_field[1]).annotate(num=Count('ban')).order_by('-num')[:10],
'Machines' : User.objects.annotate(num=Count('machine')).order_by('-num')[:10],
'Facture' : User.objects.annotate(num=Count('facture')).order_by('-num')[:10],
'Bannissement' : User.objects.annotate(num=Count('ban')).order_by('-num')[:10],
'Accès gracieux' : User.objects.annotate(num=Count('whitelist')).order_by('-num')[:10],
'Droits' : User.objects.annotate(num=Count('right')).order_by('-num')[:10],
},