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
1745c404
Commit
1745c404
authored
Mar 05, 2014
by
Serge S. Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restored SQLAlchemy 0.7 support
parent
a313e2a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
tools.py
flask_admin/contrib/sqla/tools.py
+6
-0
view.py
flask_admin/contrib/sqla/view.py
+1
-0
No files found.
flask_admin/contrib/sqla/tools.py
View file @
1745c404
...
...
@@ -32,6 +32,8 @@ def get_primary_key(model):
pks
.
append
(
get_column_for_current_model
(
p
)
.
key
)
else
:
pks
.
append
(
p
.
key
)
elif
p
.
is_primary
():
pks
.
append
(
p
.
key
)
if
len
(
pks
)
==
1
:
return
pks
[
0
]
...
...
@@ -52,8 +54,12 @@ def is_inherited_primary_key(prop):
:return: Boolean
:raises: Exceptions as they occur - no ExceptionHandling here
"""
if
not
hasattr
(
prop
,
'expression'
):
return
False
if
prop
.
expression
.
primary_key
:
return
len
(
prop
.
_orig_columns
)
==
len
(
prop
.
columns
)
-
1
return
False
def
get_column_for_current_model
(
prop
):
...
...
flask_admin/contrib/sqla/view.py
View file @
1745c404
...
...
@@ -326,6 +326,7 @@ class ModelView(BaseModelView):
columns
.
append
(
p
.
key
)
elif
hasattr
(
p
,
'columns'
):
column_inherited_primary_key
=
False
if
len
(
p
.
columns
)
!=
1
:
if
is_inherited_primary_key
(
p
):
column
=
get_column_for_current_model
(
p
)
...
...
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