- documents_books_queryset = models.Book.objects.prefetch_unrelated(
- "document_books", "slug", documents.models.Book, "dc_slug"
- )
- ctx["authors"] = models.Author.objects.all().prefetch_related(
- Prefetch("book_set", queryset=documents_books_queryset),
- Prefetch("translated_book_set", queryset=documents_books_queryset),
- )