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
45ffcf89
Commit
45ffcf89
authored
Jan 29, 2017
by
Serge S. Koval
Committed by
GitHub
Jan 29, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1420 from pawl/fix_1223
use property name rather than db column name for form_choices
parents
b7ace5d2
53d9d629
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
form.py
flask_admin/contrib/sqla/form.py
+2
-2
No files found.
flask_admin/contrib/sqla/form.py
View file @
45ffcf89
...
@@ -243,7 +243,7 @@ class AdminModelConverter(ModelConverterBase):
...
@@ -243,7 +243,7 @@ class AdminModelConverter(ModelConverterBase):
form_choices
=
getattr
(
self
.
view
,
'form_choices'
,
None
)
form_choices
=
getattr
(
self
.
view
,
'form_choices'
,
None
)
if
mapper
.
class_
==
self
.
view
.
model
and
form_choices
:
if
mapper
.
class_
==
self
.
view
.
model
and
form_choices
:
choices
=
form_choices
.
get
(
column
.
key
)
choices
=
form_choices
.
get
(
prop
.
key
)
if
choices
:
if
choices
:
return
form
.
Select2Field
(
return
form
.
Select2Field
(
choices
=
choices
,
choices
=
choices
,
...
@@ -537,7 +537,7 @@ class InlineModelConverter(InlineModelConverterBase):
...
@@ -537,7 +537,7 @@ class InlineModelConverter(InlineModelConverterBase):
def
_calculate_mapping_key_pair
(
self
,
model
,
info
):
def
_calculate_mapping_key_pair
(
self
,
model
,
info
):
"""
"""
Calculate mapping property key pair between `model` and inline model,
Calculate mapping property key pair between `model` and inline model,
including the forward one for `model` and the reverse one for inline model.
including the forward one for `model` and the reverse one for inline model.
Override the method to map your own inline models.
Override the method to map your own inline models.
:param model:
:param model:
...
...
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