I have a model named PurchaseMaster with a foreign-key partyidfk from model Parties Now when I fetch data and print my table, it shows model name along with partyidfk values like below[enter image description here][1]My models.py and views.py code and HTML code is as below[enter image description here][2][enter image description here][3][enter image description here][4][enter image description here][5] [1]: https://i.stack.imgur.com/5bzsj.png [2]: https://i.stack.imgur.com/DqOvd.png [3]: https://i.stack.imgur.com/9kZxZ.png [4]: https://i.stack.imgur.com/lbxfG.png [5]: https://i.stack.imgur.com/6QSSt.png
The problem is, that you should add a str function to your model check out this link django framework documents model
2.1m questions
2.1m answers
60 comments
56.9k users