开发者

Problem with django templates

Is there any s开发者_如何学Colution to do something like this:

{% for c in categories %}
   {% for s in c.subcategory_set %}
   <li>{{ s.name }}</li>
   {% endfor %}
{% endfor %}

???


Reverse relations on a FK have a manager. As such, you need to use the all() method if you want to access all related objects.

{% for s in c.subcategory_set.all %}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜