Django Admin: How to display value of fields with list_display from two models which are in oneToOne relation?

前端 未结 2 731
南笙
南笙 2021-02-05 23:28

I belive that the answer to my problem is simple, but I can\'t find it anywhere. Here is my predicament. I have two models: Member and MemberDetail, which are in oneToOne relati

2条回答
  •  Happy的楠姐
    2021-02-06 00:11

    You should just be able to do 'member_detail__email', etc. in list_display

    Since it's a 1-1 you should have a backref, and associated fields are referenced using two underscores.

提交回复
热议问题