[Answered ]-How can add row to a table with a field that referenced to another table in django?

2👍

You need to do:

bug= bugtraq.objects.get(id="12345")
ref_row = References(title="Mozilla Firefox")
ref_row.save()
ref_row.bugId.add(bug)

To set ManyToMany relationship, you need to do .add().

👤Rohan

Leave a comment