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
5ef405ca
Commit
5ef405ca
authored
Aug 05, 2013
by
Serge S. Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed choices support
parent
5e5b5736
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
form.py
flask_admin/contrib/sqla/form.py
+5
-3
No files found.
flask_admin/contrib/sqla/form.py
View file @
5ef405ca
...
@@ -205,8 +205,10 @@ class AdminModelConverter(ModelConverterBase):
...
@@ -205,8 +205,10 @@ class AdminModelConverter(ModelConverterBase):
return
override
(
**
kwargs
)
return
override
(
**
kwargs
)
# Check choices
# Check choices
if
mapper
.
class_
==
self
.
view
.
model
and
self
.
view
.
form_choices
:
form_choices
=
getattr
(
self
.
view
,
'form_choices'
,
None
)
choices
=
self
.
view
.
form_choices
.
get
(
column
.
key
)
if
mapper
.
class_
==
self
.
view
.
model
and
form_choices
:
choices
=
form_choices
.
get
(
column
.
key
)
if
choices
:
if
choices
:
return
Select2Field
(
return
Select2Field
(
choices
=
choices
,
choices
=
choices
,
...
@@ -221,7 +223,7 @@ class AdminModelConverter(ModelConverterBase):
...
@@ -221,7 +223,7 @@ class AdminModelConverter(ModelConverterBase):
return
None
return
None
return
converter
(
model
=
model
,
mapper
=
mapper
,
prop
=
prop
,
return
converter
(
model
=
model
,
mapper
=
mapper
,
prop
=
prop
,
column
=
column
,
field_args
=
kwargs
)
column
=
column
,
field_args
=
kwargs
)
return
None
return
None
...
...
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