Table views now show expanded foreign key references, if possible

If a table has foreign key columns, and those foreign key tables have
label_columns, the TableView will now query those other tables for the
corresponding values and display those values as links in the corresponding
table cells.

label_columns are currently detected by the inspect() function, which looks
for any table that has just two columns - an ID column and one other - and
sets the label_column to be that second non-ID column.
This commit is contained in:
Simon Willison 2017-11-17 19:09:32 -08:00
commit 1b04662585
2 changed files with 128 additions and 56 deletions

View file

@ -21,6 +21,13 @@ td {
th {
padding-right: 1em;
}
table a:link {
text-decoration: none;
color: #445ac8;
}
table a:visited {
color: #8f54c4;
}
@media only screen and (max-width: 576px) {
/* Force table to not be like tables anymore */
table, thead, tbody, th, td, tr {