Django : Post counts per user in user's list
How to return the user's posted items from another model , as example I have model called Post ( with Author as foreign key to User's Auth Model ) . how to return list of users and number of Posts for each ? may be latest post for everyone in a list . 

    def users_list(request):
    	users = UserProfile.objects.all()
    	for userposts in users:
    		posts_count = Post.objects.filter(author=users.user).count()
    	return render_to_response('users.html',{'users':users,'posts_count':posts_count})




Django : Post counts per user in user's list
===

How to return the user's posted items from another model , as example I have model called Post ( with Author as foreign key to User's Auth Model ) . how to return list of users and number of Posts for each ? may be latest post for everyone in a list . 

    def users_list(request):
    	users = UserProfile.objects.all()
    	for userposts in users:
    		posts_count = Post.objects.filter(author=users.user).count()
    	return render_to_response('users.html',{'users':users,'posts_count':posts_count})



