forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-07-26 01:35:23 +02:00
parent 6babdffb38
commit 5ad28cd910
1 changed files with 16 additions and 3 deletions

View File

@ -24,11 +24,24 @@ import matplotlib.pyplot as plt
from .front import frontlist
from drama.__main__ import app, cache
@app.route("/dramacoins", methods=["GET"])
@app.route("/dramacoins/posts", methods=["GET"])
@admin_level_required(6)
def sex(v):
for p in g.db.query(Submission).options(lazyload('*')).all() + g.db.query(Comment).options(lazyload('*')).all():
def dp(v):
for p in g.db.query(Submission).options(lazyload('*')).all():
print(p.id)
if p.author:
print(p.author.username)
p.author.dramacoins += p.upvotes + p.downvotes - 1
g.db.add(p.author)
return "sex"
@app.route("/dramacoins/comments", methods=["GET"])
@admin_level_required(6)
def dc(v):
for p in g.db.query(Comment).options(lazyload('*')).all():
print(p.id)
if p.author:
print(p.author.username)
p.author.dramacoins += p.upvotes + p.downvotes - 1
g.db.add(p.author)
return "sex"