瀏覽代碼

Inactive users queries

Denis Merigoux 8 年之前
父節點
當前提交
312545a7b7
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. 10 0
      README.md

+ 10 - 0
README.md

@@ -81,3 +81,13 @@ To backup the database, execute the command
81 81
 You can then restore your data into a freshly migrated new database with
82 82
 
83 83
     python manage.py loaddata seum.json
84
+    
85
+## Helpful commands
86
+
87
+### Inactive users
88
+
89
+To track down inactive users, launch `python manage.py shell` and type
90
+   
91
+    no_reset = Counter.objects.annotate(num_resets=Count('resets__counter')).filter(num_resets=0)
92
+    no_like = Counter.objects.annotate(num_likes=Count('likes')).filter(num_likes=0)
93
+    [ (u.user.email, u.trigramme) for u in (no_rest & no-like)]