code: def list_user_messages_view(request, targetUsername):
      ''' View of threads a user has posted in. '''
      targetUser = get_object_or_404(User, username=targetUsername)
      targetProfile = get_object_or_404(UserProfile, user=targetUser)
      user_messages = Message.objects.filter(owner=targetProfile)
      thread_pks = list(set([i.thread.pk for i in user_messages]))
      threads = Thread.objects.filter(pk__in=thread_pks)
      page_name = "Threads {0} has posted in".format(targetUser.get_full_name())
      return render_to_response('list_threads.html', {
          'page_name': page_name,
          'threads': threads,
          'targetUsername': targetUsername,
          }, context_instance=RequestContext(request)f list_user_messages_view(request, targetUsername):
      ''' View of threads a user has posted in. '''
      targetUser = get_object_or_404(User, username=targetUsername)
      targetProfile = get_object_or_404(UserProfile, user=targetUser)
      user_messages = Message.objects.filter(owner=targetProfile)
      thread_pks = list(set([i.thread.pk for i in user_messages]))
      threads = Thread.objects.filter(pk__in=thread_pks)
      page_name = "Threads {0} has posted in".format(targetUser.get_full_name())
      return render_to_response('list_threads.html', {
          'page_name': page_name,
          'threads': threads,
          'targetUsername': targetUsername,
          }, context_instance=RequestContext(request))
docs: View of threads a user has posted in.