mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Moved comment for clarity
This commit is contained in:
parent
4777362bf2
commit
c745c2715a
1 changed files with 1 additions and 1 deletions
|
|
@ -247,12 +247,12 @@ class Database:
|
|||
)
|
||||
if explicit_label_column:
|
||||
return explicit_label_column
|
||||
# If a table has two columns, one of which is ID, then label_column is the other one
|
||||
column_names = await self.execute_fn(lambda conn: table_columns(conn, table))
|
||||
# Is there a name or title column?
|
||||
name_or_title = [c for c in column_names if c in ("name", "title")]
|
||||
if name_or_title:
|
||||
return name_or_title[0]
|
||||
# If a table has two columns, one of which is ID, then label_column is the other one
|
||||
if (
|
||||
column_names
|
||||
and len(column_names) == 2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue