I have a django project using the built in user model.
I need to add relationships to the user. For now a “like” relationship for articles the user likes and a “following” relationship for other users followed.
What’s the best way to define these relationships? The django doc recommends creating a Profile model with a one on one relation to the user to add fields to the user. but given no extra fields will be added to the user profile in my case this is overkill.
Any suggestions?
For these special many-to-many relationships, you have to define them in models:
So then if you have a user, you can do things like:
As for articles, you have setup a similar schema: