Django - Caching
What is wrong with this code snippet?
Assuming
posts = Post.objects.prefetch_related('comment_set')
for post in posts:
print(post.title, [c.text for c in post.comment_set.all()])Assuming
Comment model has a ForeignKey to Post without a related_name set.