我目前被困在程序中,它将输出表中所有值为category_id == 1
的post。我似乎不能调用上述函数,你们能帮忙吗?谢谢,我们将不胜感激
{% for knowledgepost in kposts %}
<article class="media content-section">
<div class="media-body">
<div class="article-metadata">
<a class="mr-2" href="#">{{ knowledgepost.author }}</a>
<small class="text-muted">{{ knowledgepost.date_posted|date:"F d, Y" }}</small>
</div>
<h3><a class="article-title" href="{% url 'knowledge-detail' knowledgepost.id %}">{{ knowledgepost.title }}</a></h3>
++++++++ the line of code should be here+++++++++++
<p class="article-content">{{ knowledgepost.content|safe|truncatewords:"50"|linebreaks }}</p>
</div>
</article>
我希望输出能够调用数据库中的列
目前没有回答
相关问题 更多 >
编程相关推荐