Move 'deleted_utc' into 'state_user_deleted_utc' and change types.

This commit is contained in:
Ben Rog-Wilhelm 2023-06-11 04:12:14 -05:00
parent e9ca6e3239
commit 75689d88d5
24 changed files with 141 additions and 83 deletions

View file

@ -77,14 +77,14 @@ def participation_stats(v):
"signups last 24h": users.filter(User.created_utc > day).count(),
"total posts": submissions.count(),
"posting users": g.db.query(Submission.author_id).distinct().count(),
"listed posts": submissions.filter_by(is_banned=False).filter(Submission.deleted_utc == 0).count(),
"listed posts": submissions.filter_by(is_banned=False).filter(Submission.state_user_deleted_utc == None).count(),
"removed posts (by admins)": submissions.filter_by(is_banned=True).count(),
"deleted posts (by author)": submissions.filter(Submission.deleted_utc > 0).count(),
"deleted posts (by author)": submissions.filter(Submission.state_user_deleted_utc != None).count(),
"posts last 24h": submissions.filter(Submission.created_utc > day).count(),
"total comments": comments.filter(Comment.author_id.notin_((AUTOJANNY_ID,NOTIFICATIONS_ID))).count(),
"commenting users": g.db.query(Comment.author_id).distinct().count(),
"removed comments (by admins)": comments.filter_by(is_banned=True).count(),
"deleted comments (by author)": comments.filter(Comment.deleted_utc > 0).count(),
"deleted comments (by author)": comments.filter(Comment.state_user_deleted_utc != None).count(),
"comments last_24h": comments.filter(Comment.created_utc > day, Comment.author_id.notin_((AUTOJANNY_ID,NOTIFICATIONS_ID))).count(),
"post votes": g.db.query(Vote.submission_id).count(),
"post voting users": g.db.query(Vote.user_id).distinct().count(),