We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 06a7edf commit b66ca62Copy full SHA for b66ca62
util_scripts/compute_all_user_scores.py
@@ -1,6 +1,7 @@
1
# This script fills the newly created point geofield
2
# coding=utf-8
3
import django
4
+from django.db.models import Count
5
import os, sys
6
from tqdm import tqdm
7
@@ -13,6 +14,6 @@
13
14
from tigaserver_app.models import TigaUser
15
16
if __name__ == "__main__":
- qs = TigaUser.objects.all()
17
+ qs = TigaUser.objects.annotate(report_count=Count('user_reports')).filter(report_count__gt=0)
18
for user in tqdm(qs.iterator(), total=qs.count()):
19
user.update_score(commit=True)
0 commit comments