Can get you every post if you fill it
I comment it to get only the user posts

class UserPostsListView(ListView):
model = Post
template_name = 'posts/pages/index.html'
context_object_name = 'posts'
#That line can ruine everything
#ordering = ['-date_posted']
paginate_by = 1

def get_query_set(self):
    username = self.kwargs.get('username')
   user = get_object_or_404( User.objects.get(User, username=username) )
   return Post.objects.filter(author=user).ordered_by('-date_posted')

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/4ab6c581-360a-4588-b1df-58398168afb6n%40googlegroups.com.

Reply via email to