diff --git a/app.py b/app.py index 210d7b4..272c6f7 100644 --- a/app.py +++ b/app.py @@ -115,7 +115,7 @@ def post_a_post(post_key): cursor = db.aql.execute( """FOR ppp IN posts 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') @@ -157,7 +157,7 @@ def post_to_post(post_key): cursor = db.aql.execute( """FOR ppp IN posts 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') diff --git a/templates/i-posts.html b/templates/i-posts.html index f8a23fd..66c4ca7 100644 --- a/templates/i-posts.html +++ b/templates/i-posts.html @@ -35,7 +35,7 @@

Ответы:

{% for ans in posto.answers_list %} - >>{{ ans }} + >>{{ ans[0] }} {% endfor %}
{% endif %}