mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
label_column now defined on the table-being-linked-to, fixes #234
This commit is contained in:
parent
f27cabbaf3
commit
f3f4295712
4 changed files with 27 additions and 9 deletions
|
|
@ -525,8 +525,8 @@ class RowTableShared(BaseView):
|
|||
foreign_keys = table_info['foreign_keys']['outgoing']
|
||||
for fk in foreign_keys:
|
||||
label_column = (
|
||||
# First look for metadata.json definition:
|
||||
table_metadata.get('label_column')
|
||||
# First look in metadata.json definition for this foreign key table:
|
||||
self.table_metadata(database, fk['other_table']).get('label_column')
|
||||
# Fall back to label_column from .inspect() detection:
|
||||
or tables.get(fk['other_table'], {}).get('label_column')
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue