@treeio_login_required
def widget_new_messages(request, response_format='html'):
 query = (Q(reply_to__isnull=True) & (~ Q(read_by=request.user.profile)))
 messages = Object.filter_by_request(request, Message.objects.filter(query))[:5]
 return render_to_response('messaging/widgets/new_messages', {'messages': messages}, context_instance=RequestContext(request), response_format=response_format)

@ treeio_login_required def widget_new_messages ( request , response_format = 'html' ) : query = ( Q ( reply_to__isnull = True ) & ( ~ Q ( read_by = request . user . profile ) ) ) messages = Object . filter_by_request ( request , Message . objects . filter ( query ) ) [ : 5 ] return render_to_response ( 'messaging/widgets/new_messages' , { 'messages' : messages } , context_instance = RequestContext ( request ) , response_format = response_format )
a list of new messages .