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
65608c6e
Commit
65608c6e
authored
Dec 04, 2015
by
Serge S. Koval
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1125 from pawl/fix_issue_1117
make flask-admin compatible with peewee 2.7.4
parents
4732c2b2
31abd26e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
8 deletions
+3
-8
tools.py
flask_admin/contrib/peewee/tools.py
+1
-6
view.py
flask_admin/contrib/peewee/view.py
+2
-2
No files found.
flask_admin/contrib/peewee/tools.py
View file @
65608c6e
from
peewee
import
PrimaryKeyField
def
get_primary_key
(
model
):
def
get_primary_key
(
model
):
for
n
,
f
in
model
.
_meta
.
get_sorted_fields
():
return
model
.
_meta
.
primary_key
.
name
if
type
(
f
)
==
PrimaryKeyField
or
f
.
primary_key
:
return
n
def
parse_like_term
(
term
):
def
parse_like_term
(
term
):
...
...
flask_admin/contrib/peewee/view.py
View file @
65608c6e
...
@@ -2,7 +2,7 @@ import logging
...
@@ -2,7 +2,7 @@ import logging
from
flask
import
flash
from
flask
import
flash
from
flask_admin._compat
import
string_types
from
flask_admin._compat
import
string_types
,
iteritems
from
flask_admin.babel
import
gettext
,
ngettext
,
lazy_gettext
from
flask_admin.babel
import
gettext
,
ngettext
,
lazy_gettext
from
flask_admin.model
import
BaseModelView
from
flask_admin.model
import
BaseModelView
from
flask_admin.model.form
import
wrap_fields_in_fieldlist
from
flask_admin.model.form
import
wrap_fields_in_fieldlist
...
@@ -149,7 +149,7 @@ class ModelView(BaseModelView):
...
@@ -149,7 +149,7 @@ class ModelView(BaseModelView):
if
model
is
None
:
if
model
is
None
:
model
=
self
.
model
model
=
self
.
model
return
model
.
_meta
.
get_sorted_fields
(
)
return
iteritems
(
model
.
_meta
.
fields
)
def
scaffold_pk
(
self
):
def
scaffold_pk
(
self
):
return
get_primary_key
(
self
.
model
)
return
get_primary_key
(
self
.
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