Thanks Malcolm. I was looking at the question as a way to learn just what generic views can and can't do (and didn't ask it till after I'd re-read James Bennett's "get the most out of generic views"). Good to know.
The custom view to do the same thing isn't really all that complex, either. Just good to know where the line is. On May 18, 8:20 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2007-05-17 at 19:53 -0700, [EMAIL PROTECTED] wrote: > > I want to pass extra info to a generic view. Problem is, I don't want > > a single chunk of data, I want to append info to the queryset I'm > > returning (to know which topics are new). I have: > > > def topic_list(request, forum_slug, pagination_id=1): > > try: > > forum = Forum.objects.get(forum_slug=forum_slug) > > topics = Topic.objects.order_by('-is_global', '-is_sticky', '- > > topic_modification_date').filter(Q(topic_forum=forum) > > except: > > raise Http404 > > for i in topics: > > if i.topic_modification_date > request.session['last_seen']: > > i.last_seen = "New" > > > return object_list(request, queryset=topics, paginate_by = 30, > > allow_empty = True, page = pagination_id, > > extra_context = {'forum': forum, 'forum_slug': forum_slug, > > 'forum_name': forum.forum_name}, > > template_name = 'myghtyboard/topics_list.html', template_object_name = > > 'topics') > > > Using a custom view, I could do that for i in topics loop, then in the > > template access topic.last_seen. Can I do it with the generic view? > > No. There comes a point at which you have to agree to say "I'm no longer > doing simple query -> template stuff and I need to write my own view." > You've reached that point. > > Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---