From the example of Django Book, I understand if I create models as following:
from xxx import B
class A(models.Model):
b = ManyToManyField(B)
The Django would create a new table(A_B) beyond Table A, which has three columns:
- id
- a_id
- b_id
But now I want to add a new column in the Table A_B, thus would be very easy if I use normal SQL, but now anyone can help me how to do? I can’t find any useful information in this book.
It’s very easy using django too! You can use
throughto define your own manytomany intermediary tablesDocumentation provides an example addressing your issue: