Replies: 1 comment
-
|
Hi @sternalon |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All.
I am new to SQLAdmin. Apologies if this is straightforward.
I have a models named Country, Company and Fees .
The Company model has a "country" has a field country, which is a foreign key pointing at the Country table.
The Fee model has a "company" has a field country, which is a foreign key pointing at the Company table.
I would like to display the country in my fees table (ie: the grandchild). I thought that it would work to add the following to the FeeAdmin: Fee.company.country
So the FeeAdmin looks like
class FeeAdmin(ModelView, model=Fee):
column_list = [Fee.id,
Fee.company,
Fee.company.country,
Fee.percentage]
But it seems that this does not work.
How can I add the grandchildren fields? I guess I could do this using the query field, but I could not find nice examples online.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions