diff --git a/sqladmin/forms.py b/sqladmin/forms.py index 1328e516..47076298 100644 --- a/sqladmin/forms.py +++ b/sqladmin/forms.py @@ -612,7 +612,11 @@ async def get_model_form( attributes = [] names = only or mapper.attrs.keys() for name in names: - if exclude and name in exclude: + if ( + exclude + and name in exclude + or isinstance(mapper.attrs[name], MappedSQLExpression) + ): continue attributes.append((name, mapper.attrs[name]))