[Answered ]-How to convert many to many field to foreign key?

2👍

There is no simple mechanism, but you can always do the following:

  1. Create a new ForeignKey (say, brand)

  2. Copy existing data from brands (by slicing the first result since there can be multiple with a ManyToMany relation) to brand

  3. Delete the field brands

👤Selcuk

Leave a comment