Skip to content

Commit c82e1c6

Browse files
Use default value as placeholder (#709)
1 parent 65f2c29 commit c82e1c6

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

aiohttp_admin/backends/sqlalchemy.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ def __init__(self, db: AsyncEngine, model_or_table: Union[sa.Table, type[Declara
138138
else:
139139
field, inp = FIELD_TYPES.get(type(c.type), ("TextField", "TextInput"))
140140
props = {}
141+
142+
if isinstance(c.default, sa.ColumnDefault):
143+
props["placeholder"] = c.default.arg
144+
141145
self.fields[c.name] = {"type": field, "props": props}
142146
if c.computed is None:
143147
# TODO: Allow custom props (e.g. disabled, multiline, rows etc.)

0 commit comments

Comments
 (0)