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
41a68dde
Commit
41a68dde
authored
Dec 14, 2013
by
Bryan Hoyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Parse optional named filters from filter url"
This reverts commit
c424c3fe
.
parent
08d09c31
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
22 deletions
+15
-22
base.py
flask_admin/model/base.py
+15
-22
No files found.
flask_admin/model/base.py
View file @
41a68dde
...
@@ -958,34 +958,27 @@ class BaseModelView(BaseView, ActionsMixin):
...
@@ -958,34 +958,27 @@ class BaseModelView(BaseView, ActionsMixin):
sort_desc
=
request
.
args
.
get
(
'desc'
,
None
,
type
=
int
)
sort_desc
=
request
.
args
.
get
(
'desc'
,
None
,
type
=
int
)
search
=
request
.
args
.
get
(
'search'
,
None
)
search
=
request
.
args
.
get
(
'search'
,
None
)
filter_idx_by_label
=
dict
((
flt
.
query_label
(),
i
)
for
i
,
flt
in
enumerate
(
self
.
_filters
))
# Gather filters
# Gather filters
if
self
.
_filters
:
if
self
.
_filters
:
sfilters
=
[]
sfilters
=
[]
for
n
in
request
.
args
:
for
n
in
request
.
args
:
if
not
n
.
startswith
(
'flt'
):
if
n
.
startswith
(
'flt'
):
ofs
=
n
.
find
(
'_'
)
if
ofs
==
-
1
:
continue
continue
pos
,
filter_label
=
n
[
3
:]
.
split
(
'_'
,
1
)
# If pos not specified, just add incrementally to the list.
pos
=
int
(
pos
)
if
pos
else
len
(
sfilters
)
try
:
try
:
# See if filter is numeric
pos
=
int
(
n
[
3
:
ofs
])
idx
=
int
(
filter_label
)
idx
=
int
(
n
[
ofs
+
1
:]
)
except
ValueError
:
except
ValueError
:
# If non-numeric, look filter up by name
try
:
idx
=
filter_idx_by_label
[
filter_label
]
except
KeyError
:
# No matching filter name
continue
continue
if
0
<=
idx
<
len
(
self
.
_filters
):
if
idx
>=
0
and
idx
<
len
(
self
.
_filters
):
flt
=
self
.
_filters
[
idx
]
flt
=
self
.
_filters
[
idx
]
value
=
request
.
args
[
n
]
value
=
request
.
args
[
n
]
if
flt
.
validate
(
value
):
if
flt
.
validate
(
value
):
sfilters
.
append
((
pos
,
(
idx
,
flt
.
clean
(
value
))))
sfilters
.
append
((
pos
,
(
idx
,
flt
.
clean
(
value
))))
...
...
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