aboutsummaryrefslogtreecommitdiffstats
path: root/server/views.py
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2022-05-31 15:59:05 +0200
committerAndrea Lepori <alepori@student.ethz.ch>2022-05-31 15:59:06 +0200
commit36daddac8b3308c71ccef4e9c7b2b160a530d38a (patch)
tree466711b8fa2c443fcd756617ce9b4be0f7772a5c /server/views.py
parentadd group on csv export (diff)
downloadscout-subs-36daddac8b3308c71ccef4e9c7b2b160a530d38a.tar.gz
scout-subs-36daddac8b3308c71ccef4e9c7b2b160a530d38a.zip
doclist add group count and quick filters
Diffstat (limited to 'server/views.py')
-rw-r--r--server/views.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/server/views.py b/server/views.py
index 68c1e77..601bd0f 100644
--- a/server/views.py
+++ b/server/views.py
@@ -1050,6 +1050,12 @@ def doclist(request):
'error': error,
'error_text': error_text,
'settings': settings,
+ 'total_count': documents.count,
+ 'colonia_count': documents.filter(user__groups__name__contains="colonia").count,
+ 'muta_count': documents.filter(user__groups__name__contains="muta").count,
+ 'reparto_count': documents.filter(user__groups__name__contains="reparto").count,
+ 'posto_count': documents.filter(user__groups__name__contains="posto").count,
+ 'clan_count': documents.filter(user__groups__name__contains="clan").count,
}
# check if download multiple documents
@@ -1274,6 +1280,12 @@ def doclist_readonly(request):
'error': error,
'error_text': error_text,
'settings': settings,
+ 'total_count': documents.count,
+ 'colonia_count': documents.filter(user__groups__name__contains="colonia").count,
+ 'muta_count': documents.filter(user__groups__name__contains="muta").count,
+ 'reparto_count': documents.filter(user__groups__name__contains="reparto").count,
+ 'posto_count': documents.filter(user__groups__name__contains="posto").count,
+ 'clan_count': documents.filter(user__groups__name__contains="clan").count,
}
# check if download multiple documents