26
It should be somepost.comments.all()
.
somepost.comments
returns a queryset. all
accesses the objects in it.
1
It should be somepost.comment_set.all()
_set
is used for reverse mapping in django models
.
- [Django]-Is this the right way to do dependency injection in Django?
- [Django]-Substring in a django template?
- [Django]-Django: guidelines for speeding up template rendering performance
Source:stackexchange.com