【发布时间】:2010-06-18 15:03:26
【问题描述】:
如果有类似的查询
following = Relations.objects.filter(initiated_by = request.user)
其中我让所有用户跟随当前登录的用户, 我想显示这些用户的博客文章。使用如下查询:
blog = New.objects.filter(created_by = following)
它只向我显示 id = 1 的用户的博客文章(尽管当前登录的用户实际上并没有关注他) 在模板中我有:
{% for object in blog %}
<a href='/accounts/profile_view/{{object.created_by}}/'> {{object.created_by}}</a> <br />
{{object.post}}<br />
{% endfor %}
我哪里错了?
【问题讨论】:
标签: django filter character-encoding