Good day. There is a problem, I have an array with tasks. It contains tasks that relate directly to me (for my performance), as well as tasks that I ordered.
I need to calculate the number of tasks that I have to complete, and the number of tasks that I have to complete.
This is the for loop for my tasks:
{% for task in tasks if (task.deadline > "now"|date(datetime_type)) and (task.perfomer.id == app.user.id) %} вывод задания {% endfor %} It looks like a loop for my orders:
{% for task in tasks if (task.deadline > "now"|date(datetime_type)) and (task.mentor.id == app.user.id) and task.perfomer.id != app.user.id %} вывод задания {% endfor %} And before each loop I gently calculate how many tasks are in each "array". those. something like: {{ (tasks if (task.deadline > "now"|date(datetime_type)) and (task.perfomer.id == app.user.id))|length }}