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
baf191d1
Commit
baf191d1
authored
Feb 15, 2016
by
Serge S. Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed tuple-based sorting arguments
parent
efbfb80f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
view.py
flask_admin/contrib/sqla/view.py
+2
-3
No files found.
flask_admin/contrib/sqla/view.py
View file @
baf191d1
...
@@ -473,11 +473,9 @@ class ModelView(BaseModelView):
...
@@ -473,11 +473,9 @@ class ModelView(BaseModelView):
column_name
=
c
[
0
]
column_name
=
c
[
0
]
else
:
else
:
column
,
path
=
tools
.
get_field_with_path
(
self
.
model
,
c
)
column
,
path
=
tools
.
get_field_with_path
(
self
.
model
,
c
)
column_name
=
c
column_name
=
text_type
(
c
)
if
path
and
hasattr
(
path
[
0
],
'property'
):
if
path
and
hasattr
(
path
[
0
],
'property'
):
# column is in another table, use full path as column_name
column_name
=
text_type
(
c
)
self
.
_sortable_joins
[
column_name
]
=
path
self
.
_sortable_joins
[
column_name
]
=
path
elif
path
:
elif
path
:
raise
Exception
(
"For sorting columns in a related table, "
raise
Exception
(
"For sorting columns in a related table, "
...
@@ -490,6 +488,7 @@ class ModelView(BaseModelView):
...
@@ -490,6 +488,7 @@ class ModelView(BaseModelView):
# column_name must match column_name used in `get_list_columns`
# column_name must match column_name used in `get_list_columns`
result
[
column_name
]
=
column
result
[
column_name
]
=
column
return
result
return
result
def
get_list_columns
(
self
):
def
get_list_columns
(
self
):
...
...
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