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
7a34b0a5
Commit
7a34b0a5
authored
Sep 17, 2016
by
Tom Kedem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed lazy string manipulation for remote properties.
parent
47080aeb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
view.py
flask_admin/contrib/sqla/view.py
+9
-2
No files found.
flask_admin/contrib/sqla/view.py
View file @
7a34b0a5
...
@@ -2,6 +2,7 @@ import logging
...
@@ -2,6 +2,7 @@ import logging
import
warnings
import
warnings
import
inspect
import
inspect
from
speaklater
import
is_lazy_string
,
make_lazy_string
from
sqlalchemy.orm.attributes
import
InstrumentedAttribute
from
sqlalchemy.orm.attributes
import
InstrumentedAttribute
from
sqlalchemy.orm
import
joinedload
,
aliased
from
sqlalchemy.orm
import
joinedload
,
aliased
from
sqlalchemy.sql.expression
import
desc
from
sqlalchemy.sql.expression
import
desc
...
@@ -637,8 +638,14 @@ class ModelView(BaseModelView):
...
@@ -637,8 +638,14 @@ class ModelView(BaseModelView):
if
not
isinstance
(
name
,
string_types
):
if
not
isinstance
(
name
,
string_types
):
visible_name
=
self
.
get_column_name
(
name
.
property
.
key
)
visible_name
=
self
.
get_column_name
(
name
.
property
.
key
)
else
:
else
:
names
=
name
.
split
(
'.'
)
names
=
[
self
.
get_column_name
(
name_item
)
for
name_item
in
name
.
split
(
'.'
)]
visible_name
=
' / '
.
join
([
self
.
get_column_name
(
names_item
)
for
names_item
in
names
])
def
concat_func
():
return
' / '
.
join
([
str
(
names_item
)
for
names_item
in
names
])
if
any
(
map
(
is_lazy_string
,
names
)):
visible_name
=
make_lazy_string
(
concat_func
)
else
:
visible_name
=
concat_func
()
type_name
=
type
(
column
.
type
)
.
__name__
type_name
=
type
(
column
.
type
)
.
__name__
...
...
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