So I have three models
class Post(....
class Project(....
# have a many to many relationship
class ProjectPost(....
post = ..... # foreignkey
project = .... # foreignkey
The data set I want to select is a list of Post objects given a Project object.
This is what I tried:
posts_list = ProjectPost.objects.filter(project=project_object).select_related("post")
But this returns a list of ProjectPost objects rather than a list of Post objects. What is the correct way of doing this?