- Django 3 Web Development Cookbook
- Aidas Bendoraitis Jake Kronika
- 63字
- 2025-04-04 13:15:08
How it works...
At first, we add a new many-to-many field to the Idea model, and a migration is generated to update the database accordingly. Then, we create a data migration that will copy the existing relations from the foreign key category to the new many-to-many categories. Lastly, we remove the foreign key field from the model, and update the database once more.