Skip to content

Commit 1ed7062

Browse files
committed
add rich_text_columns and link_column options
1 parent 6211a46 commit 1ed7062

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

app/main.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,25 @@ async def main():
106106
]
107107
except TypeError:
108108
visible_filters = None
109+
# rich text columns
110+
try:
111+
rich_text_columns = [
112+
column
113+
for column in table._meta.columns
114+
if column._meta.name
115+
in BASE_CONFIG[capitalize_table_name].get(
116+
"rich_text_columns", None
117+
)
118+
]
119+
except TypeError:
120+
rich_text_columns = None
121+
# link column
122+
link_column = [
123+
column
124+
for column in table._meta.columns
125+
if column._meta.name
126+
== BASE_CONFIG[capitalize_table_name].get("link_column", None)
127+
]
109128
# menu_group
110129
menu_group = BASE_CONFIG[capitalize_table_name].get(
111130
"menu_group", None
@@ -116,6 +135,8 @@ async def main():
116135
table_class=table,
117136
visible_columns=visible_columns,
118137
visible_filters=visible_filters,
138+
rich_text_columns=rich_text_columns,
139+
link_column=None if link_column == [] else link_column[0],
119140
menu_group=menu_group,
120141
)
121142
)

config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ tables:
88
# - actor_id
99
# - first_name
1010
# menu_group: Movies
11+
# link_column: first_name
1112
# Address:
1213
# visible_columns:
1314
# - address_id
@@ -18,6 +19,7 @@ tables:
1819
# - address
1920
# - city_id
2021
# menu_group: Location
22+
# rich_text_columns: address # it only works in the Text type column
2123
# City:
2224
# visible_columns:
2325
# - city_id

0 commit comments

Comments
 (0)