Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
flask-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
flask-admin
Commits
3f3fb543
Commit
3f3fb543
authored
Apr 16, 2015
by
Serge S. Koval
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #843 from nitishr/patch-1
Warn on multi-column field in form. fixes #575
parents
9ac068e0
e6a06c6f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
form.py
flask_admin/contrib/sqla/form.py
+4
-1
view.py
flask_admin/contrib/sqla/view.py
+1
-0
No files found.
flask_admin/contrib/sqla/form.py
View file @
3f3fb543
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
:
...
...
flask_admin/contrib/sqla/view.py
View file @
3f3fb543
...
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment