we can chat now?
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Simple_Not 2023-07-19 01:12:50 +10:00
parent ce5f33e604
commit 88e2b021f9
2 changed files with 3 additions and 3 deletions

4
app.py
View File

@ -115,7 +115,7 @@ def post_a_post(post_key):
cursor = db.aql.execute( cursor = db.aql.execute(
"""FOR ppp IN posts """FOR ppp IN posts
LET children = (FOR v IN 1OUTBOUND ppp post_parents RETURN v) LET children = (FOR v IN 1OUTBOUND ppp post_parents RETURN v)
UPDATE ppp WITH { answers_list : children[*]._key } IN posts""" UPDATE ppp WITH { answers_list : [ children[*]._key, children[*].answers_num ] } IN posts"""
) )
postos = db.collection('posts') postos = db.collection('posts')
@ -157,7 +157,7 @@ def post_to_post(post_key):
cursor = db.aql.execute( cursor = db.aql.execute(
"""FOR ppp IN posts """FOR ppp IN posts
LET children = (FOR v IN 1OUTBOUND ppp post_parents RETURN v) LET children = (FOR v IN 1OUTBOUND ppp post_parents RETURN v)
UPDATE ppp WITH { answers_list : children[*]._key } IN posts""" UPDATE ppp WITH { answers_list : [ children[*]._key, children[*].answers_num ] } IN posts"""
) )
postos = db.collection('posts') postos = db.collection('posts')

View File

@ -35,7 +35,7 @@
<p>Ответы:</p> <p>Ответы:</p>
<div class="collection"> <div class="collection">
{% for ans in posto.answers_list %} {% for ans in posto.answers_list %}
<a href="#post-{{ ans }}" class="collection-item">>>{{ ans }}</a> <a href="#post-{{ ans[0] }}" class="collection-item">>>{{ ans[0] }}</a>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}