DEV Community

Discussion on: BUILD THE REST API USING PYTHON DJANGO - PART 3 🐍

Collapse
 
gerlc profile image
GerLC • Edited

Hello, I got a question with the ManyToManyField, how does it works? What happends if i put the ManyToManyField in the Employee model instead of the project?
In a mini project that i did, i created a model that contained the two IDs using the ForeignKey.
Thanks for the tutorial

Collapse
 
devlazar profile image
devlazar

When you have the ManyToManyField, in the background, Django creates an intermediary join table to represent that ManyToMany relationship. You can read about it in the docs, there are well-explained ways of using the ManyToMany Field. Check it out! docs.djangoproject.com/en/3.1/ref/...