posts.py 551 B

1234567891011121314
  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(request.user_acl, threads_categories, Thread.objects)
  7. def get_posts_queryset(self, user, profile, threads_queryset):
  8. return profile.post_set.select_related('thread', 'poster').filter(
  9. thread_id__in=threads_queryset.values('id'),
  10. )