0
I have a Django magazine that receives data from a table to display the list on the screen, as below:
{% block content %}
{% for item in itens_lista %}
<div class="post">
<h1><a href="">{{ item.DESCR_ITEM}}</a></h1>
</div>
{% endfor %}
{% endblock %}
For each item read a link is generated that opens the edit of the item, however, in addition to the description (item.DESCR_ITEM
) of the item I would like to also display the code (item.COD_ITEM
).
Today displays like this:
- Cellular
- Notebook
- Flash drive
I’d like it to stay that way:
- 001 - Cellular
- 002 - Notebook
- 003 - Pendrive
In advance I thank you for your help.
The code was not correct when I pasted it. Where {{ item appears.DESCR_ITEM}} is actually an html link whose label is this. I want this label to concatenate COD_ITEM + DESCR_ITEM
– Jorge Gonzaga
You tested my answer?
– Sidon
I just tested. It worked perfectly. Thank you so much for the tip.
– Jorge Gonzaga
I put the accepted. Thanks again.
– Jorge Gonzaga
Cool, It is interesting to always put the accepted when someone responds, so you and the author of the answer earn points. :-)
– Sidon