This commit is contained in:
parent
ce5f33e604
commit
88e2b021f9
4
app.py
4
app.py
@ -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')
|
||||||
|
@ -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 %}
|
||||||
|
Loading…
Reference in New Issue
Block a user