I am trying to create a data model in Django, and would like some help from those familiar with Django ORM to advice the right approach to create the data models.
The idea: I want to store a list of hashtags that are associated in social media posts. 1 post can have multiple hashtags.
Question 1: Is below the right data representation of the model above?
Hashtag table:
==============
- hashtag_id (primary key)
- hashtag_name
Post table:
============
- Post_id (primary key)
- Post_name
Hashtag-post link table:
=========================
- hashtag_id (link to id in hashtag table, need to specify primary key?)
- Post_id (link to id in post table)
Question 2: How do I create the ORM model with proper primary/foreign keys?
Question 3: How do I make this query: Query all the posts associated in a hashtag in Django ORM?