T
T
turdaxunov2021-01-17 21:26:18
Django
turdaxunov, 2021-01-17 21:26:18

How to retrieve an element from the database without using a loop?

How to retrieve an element from the database without using a loop?
I used loop in html code:

{% for post in posts %}
<h4 class="rheading">Категория <i class="icon-angle-right">{{ post.category }}</i><span></span></h4>
{% endfor%}


Displays several times:
6004809707418058842391.jpeg

I would like next to Category was the category in which the person is located.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2021-01-18
@bacon

the category in which the person is
calculate it in views

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question