This commit is contained in:
parent
c30e2c8705
commit
089b022a3b
6
app.py
6
app.py
@ -112,6 +112,12 @@ def post_a_post(post_key):
|
||||
UPDATE ppp WITH { answers_num : COUNT_DISTINCT( children[*]._key ) } IN posts"""
|
||||
)
|
||||
|
||||
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"""
|
||||
)
|
||||
|
||||
postos = db.collection('posts')
|
||||
postos = sorted(postos, key=lambda posto: posto['_key'], reverse=False)
|
||||
|
||||
|
@ -36,6 +36,13 @@
|
||||
<!-- <a href="#" hx-post="/post_my_post/{{ posto._key }}" hx-target="#neu-posts" >Answer me!</a> -->
|
||||
<a href="#answer-post" hx-post="/answer_post/{{ posto._key }}" hx-target="#answer-post" >Ответить этому.</a>
|
||||
</div>
|
||||
{% if posto.answers_list | length > 0 %}
|
||||
{% for ans in posto.answers_list %}
|
||||
<div class="card-action right">
|
||||
<a href="#post-{{ ans }}">>>{{ posto.ans }}</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user