Commit 3f3fb543 authored by Serge S. Koval's avatar Serge S. Koval

Merge pull request #843 from nitishr/patch-1

Warn on multi-column field in form. fixes #575
parents 9ac068e0 e6a06c6f
import warnings
from wtforms import fields, validators
from sqlalchemy import Boolean, Column
......@@ -158,7 +160,8 @@ class AdminModelConverter(ModelConverterBase):
columns = filter_foreign_columns(model.__table__, prop.columns)
if len(columns) > 1:
raise TypeError('Can not convert multiple-column properties (%s.%s)' % (model, prop.key))
warnings.warn('Can not convert multiple-column properties (%s.%s)' % (model, prop.key))
return None
column = columns[0]
else:
......
......@@ -393,6 +393,7 @@ class ModelView(BaseModelView):
if len(filtered) > 1:
warnings.warn('Can not convert multiple-column properties (%s.%s)' % (self.model, p.key))
continue
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