From 88e2b021f99515daa05d8da662d08f36c7493e72 Mon Sep 17 00:00:00 2001 From: Simple_Not <44047940+moonbaseDelta@users.noreply.github.com> Date: Wed, 19 Jul 2023 01:12:50 +1000 Subject: [PATCH] we can chat now? --- app.py | 4 ++-- templates/i-posts.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 %}