I'm trying to use a generic list view like this:

def latest_topic_list(request):
        from django.views.generic.list_detail import object_list
        topics =
Topic.objects.order_by('-topic_modification_date')[:40]
        for i in topics:
                if i.topic_modification_date >
request.session['last_seen']:
                        i.last_seen = "New"
                else:
                        i.last_seen = "Not new"
                i.recent_posts =
i.post_set.all().order_by('-post_date')[:5]
        forum_name = _('Latest Active Topics')
        return object_list(request, queryset=topics, extra_context =
{'forum_name':forum_name, 'user':request.user}, template_name =
'forum/topic_list.html')

Which is fine so far as listing out the topics goes. My problem comes
when I try to show recent_posts... there I get nothing, using this
template code:

{% for topic in object_list %}
<dt><a href="link">{{ topic.topic_name }}</a></dt>
<dd>
<ul>
{% for post in topic.recent_posts %}
<li><a href="post link">{{post.post_text|striptags|truncatewords:"14"}}
</a></li>
{% endfor %}
</ul>
</dd>

So why doesn't topic.recentposts come over?


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to