posts.py 559 B

123456789101112131415
  1. from misago.threads.models import Thread
  2. from misago.threads.permissions import exclude_invisible_threads
  3. from .threads import UserThreads
  4. class UserPosts(UserThreads):
  5. def get_threads_queryset(self, request, threads_categories, profile):
  6. return exclude_invisible_threads(
  7. request.user, threads_categories, Thread.objects)
  8. def get_posts_queryset(self, user, profile, threads_queryset):
  9. return profile.post_set.select_related('thread', 'poster').filter(
  10. thread_id__in=threads_queryset.values('id')
  11. )