check posts
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Simple_Not 2023-07-14 01:32:56 +10:00
parent 10b0643899
commit 1d5369d73a

6
app.py
View File

@ -86,6 +86,12 @@ def post_a_post(post_key):
}, overwrite_mode='update') }, overwrite_mode='update')
cursor = db.aql.execute(
"""FOR ppp IN posts
LET children = (FOR v IN 1..9999 OUTBOUND ppp post_parents RETURN v)
UPDATE ppp WITH { children_num : COUNT_DISTINCT( children[*]._key ) } IN posts"""
)
postos = db.collection('posts') postos = db.collection('posts')
postos = sorted(postos, key=lambda posto: posto['_key'], reverse=False) postos = sorted(postos, key=lambda posto: posto['_key'], reverse=False)