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
19fb86f3
Commit
19fb86f3
authored
Jun 05, 2016
by
discort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed peewee in list filters bug using postgres
parent
69fb5ab5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
filters.py
flask_admin/contrib/peewee/filters.py
+2
-2
No files found.
flask_admin/contrib/peewee/filters.py
View file @
19fb86f3
...
@@ -99,7 +99,7 @@ class FilterInList(BasePeeweeFilter):
...
@@ -99,7 +99,7 @@ class FilterInList(BasePeeweeFilter):
return
[
v
.
strip
()
for
v
in
value
.
split
(
','
)
if
v
.
strip
()]
return
[
v
.
strip
()
for
v
in
value
.
split
(
','
)
if
v
.
strip
()]
def
apply
(
self
,
query
,
value
):
def
apply
(
self
,
query
,
value
):
return
query
.
filter
(
self
.
column
<<
value
)
return
query
.
filter
(
self
.
column
<<
(
value
or
[
None
])
)
def
operation
(
self
):
def
operation
(
self
):
return
lazy_gettext
(
'in list'
)
return
lazy_gettext
(
'in list'
)
...
@@ -108,7 +108,7 @@ class FilterInList(BasePeeweeFilter):
...
@@ -108,7 +108,7 @@ class FilterInList(BasePeeweeFilter):
class
FilterNotInList
(
FilterInList
):
class
FilterNotInList
(
FilterInList
):
def
apply
(
self
,
query
,
value
):
def
apply
(
self
,
query
,
value
):
# NOT IN can exclude NULL values, so "or_ == None" needed to be added
# NOT IN can exclude NULL values, so "or_ == None" needed to be added
return
query
.
filter
(
~
(
self
.
column
<<
value
)
|
(
self
.
column
>>
None
))
return
query
.
filter
(
~
(
self
.
column
<<
(
value
or
[
None
])
)
|
(
self
.
column
>>
None
))
def
operation
(
self
):
def
operation
(
self
):
return
lazy_gettext
(
'not in list'
)
return
lazy_gettext
(
'not in list'
)
...
...
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