I have old cms database, structure isn't perfect and it can't be modified but i need to query using django
TABLE posts
(post_id
)
TABLE posts_text
(post_id
,
post_text
)
TABLE episode
(id
,
season_id
,
episode_name
)
TABLE episode_post_relationship
(id
,
season_id
,
episode_id
,
post_id
)
Please help me to create django models with right tables relationships. Should i use OneToOneField, ForeignKey, ManyToManyField and etc or pure join?
I'm trying to get Episodes from episode_post_relationship table with posts_text
.posts_text
and posts
.some_other_col
but can't specify that episode_post_relationship
table should join posts_text
on post_id
and the same for posts
table.