【发布时间】:2022-01-17 00:46:55
【问题描述】:
我正在编写一个应用程序“破折号”如何成为许多用户的起点。 “应用程序仪表板”。我想转换卡片中的应用程序列表,“组合样式”。
用户登录平台,并在 url .../dash 中打开 dash(django app)。到这里就完美了。
使用通用视图 - ListView - 我们获得将在平台中可用的应用程序列表(如果模型中存在,它已安装并可供用户使用的应用程序)
urls.py:
path('dash/', views.ListView_Dash_Apps.as_view()),
views.py:
class ListView_Dash_Apps(ListView):
template_name = "dash/ListarAplicaciones.html"
model = App
而在html模板中,如何迭代object_list的列??? 有了这个我可以迭代行,但不是列,我收到模型中声明的 str 输出。
<ul>
{% for e in object_list %}
<li>{{ e }}</li>
{% endfor %}
</ul>
如果我可以读取列数据并包含在 html 中(应用程序、url_app、图标等)
【问题讨论】:
标签: python django django-views django-templates