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
a76c004d
Commit
a76c004d
authored
Mar 19, 2014
by
Serge S. Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not create relation if form_columns is set and it is missing in the list
parent
d615e70a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
form.py
flask_admin/contrib/sqla/form.py
+5
-0
No files found.
flask_admin/contrib/sqla/form.py
View file @
a76c004d
...
...
@@ -95,6 +95,11 @@ class AdminModelConverter(ModelConverterBase):
return
QuerySelectField
(
**
kwargs
)
def
_convert_relation
(
self
,
prop
,
kwargs
):
# Check if relation is specified
form_columns
=
getattr
(
self
.
view
,
'form_columns'
,
None
)
if
form_columns
and
prop
.
key
not
in
form_columns
:
return
None
remote_model
=
prop
.
mapper
.
class_
column
=
prop
.
local_remote_pairs
[
0
][
0
]
...
...
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