class Post(models.Model):
title = models.CharField(max_length=255)
category = models.ForeignKey(Category)
...
class Comment(models.Model):
body = models.TextField()
post = models.ForeignKey(Post)
...
ビュー
def single_post(request,slug):
p = Post.objects.get(slug=slug)
cat = Category.objects.all()
return render_to_response('single_post.html',{'p':p,'cat':cat},context_instance=RequestContext(request))
テンプレートの単一の投稿からコメントを取得するには?