This commit is contained in:
parent
10b0643899
commit
1d5369d73a
6
app.py
6
app.py
@ -86,6 +86,12 @@ def post_a_post(post_key):
|
||||
}, 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 = sorted(postos, key=lambda posto: posto['_key'], reverse=False)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user