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
a12d868f
Commit
a12d868f
authored
Jul 01, 2019
by
P.J. Janse van Rensburg
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
git://github.com/MihaiBalint/flask-admin
into MihaiBalint-master
parents
5c3ba0e2
477c0a26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
ajax.py
flask_admin/contrib/sqla/ajax.py
+5
-2
No files found.
flask_admin/contrib/sqla/ajax.py
View file @
a12d868f
...
@@ -58,13 +58,16 @@ class QueryAjaxModelLoader(AjaxModelLoader):
...
@@ -58,13 +58,16 @@ class QueryAjaxModelLoader(AjaxModelLoader):
return
getattr
(
model
,
self
.
pk
),
as_unicode
(
model
)
return
getattr
(
model
,
self
.
pk
),
as_unicode
(
model
)
def
get_query
(
self
):
return
self
.
session
.
query
(
self
.
model
)
def
get_one
(
self
,
pk
):
def
get_one
(
self
,
pk
):
# prevent autoflush from occuring during populate_obj
# prevent autoflush from occuring during populate_obj
with
self
.
session
.
no_autoflush
:
with
self
.
session
.
no_autoflush
:
return
self
.
session
.
query
(
self
.
model
)
.
get
(
pk
)
return
self
.
get_query
(
)
.
get
(
pk
)
def
get_list
(
self
,
term
,
offset
=
0
,
limit
=
DEFAULT_PAGE_SIZE
):
def
get_list
(
self
,
term
,
offset
=
0
,
limit
=
DEFAULT_PAGE_SIZE
):
query
=
self
.
session
.
query
(
self
.
model
)
query
=
self
.
get_query
(
)
filters
=
(
cast
(
field
,
String
)
.
ilike
(
u'
%%%
s
%%
'
%
term
)
for
field
in
self
.
_cached_fields
)
filters
=
(
cast
(
field
,
String
)
.
ilike
(
u'
%%%
s
%%
'
%
term
)
for
field
in
self
.
_cached_fields
)
query
=
query
.
filter
(
or_
(
*
filters
))
query
=
query
.
filter
(
or_
(
*
filters
))
...
...
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