Commit 9ac068e0 authored by Serge S. Koval's avatar Serge S. Koval

Merge pull request #841 from nitishr/patch-1

warn on multi-column properties - fixes #575
parents 7bca6d9e 0aa2b6eb
import logging
import warnings
from sqlalchemy.orm.attributes import InstrumentedAttribute
from sqlalchemy.orm import joinedload
......@@ -391,8 +392,7 @@ class ModelView(BaseModelView):
filtered = tools.filter_foreign_columns(self.model.__table__, p.columns)
if len(filtered) > 1:
# TODO: Skip column and issue a warning
raise TypeError('Can not convert multiple-column properties (%s.%s)' % (self.model, p.key))
warnings.warn('Can not convert multiple-column properties (%s.%s)' % (self.model, p.key))
column = filtered[0]
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment