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
ad355a16
Commit
ad355a16
authored
Jun 11, 2014
by
Andrew Grigorev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Notice a get_count_query necessity in the docstring
This wont let me to revert #
45a27235
parent
74d19e9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
view.py
flask_admin/contrib/sqla/view.py
+5
-0
No files found.
flask_admin/contrib/sqla/view.py
View file @
ad355a16
...
@@ -608,6 +608,11 @@ class ModelView(BaseModelView):
...
@@ -608,6 +608,11 @@ class ModelView(BaseModelView):
def
get_count_query
(
self
):
def
get_count_query
(
self
):
"""
"""
Return a the count query for the model type
Return a the count query for the model type
A query(self.model).count() approach produces an excessive
subquery, so query(func.count('*')) should be used instead.
See #45a2723 commit message for details.
"""
"""
return
self
.
session
.
query
(
func
.
count
(
'*'
))
.
select_from
(
self
.
model
)
return
self
.
session
.
query
(
func
.
count
(
'*'
))
.
select_from
(
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