AKV
AKV

Reputation: 181

Django admin multiple table display

We have following Database design

Payment table with user id from user table Profile table one-to-one with User table Registration table one to one with User table

In the admin system we want to provide the profile object with Payment details and Registration Details. As there is no foreign key relation between Regsitration and profile table Can we achieve an inline of Registration details within Profile object in admin.

Thanks in advance

Upvotes: 0

Views: 880

Answers (1)

Brandon Taylor
Brandon Taylor

Reputation: 34573

As far as I know, Django assumes that inline models have a direct relationship to their parent, and you can't do an inline "through" another table. If I'm wrong, someone please correct me.

I would write my own view in this case, as it's going to be easier, imo, than trying to tweak admin to get it to do what you need.

Upvotes: 3

Related Questions